Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. -- Abaixo colocar o PK_ID da DIM_FATURA
  2.  
  3. select distinct aux_codigo_Reserva
  4. from
  5. (
  6. select * from fact_conta_cliente where pk_id in
  7. (select id_fact_conta_cliente from fact_factura_conta_cliente where id_factura = 22578115)
  8. ) a
  9.  
  10.  
  11. select count(*), min(a.dt_registo), max(a.dt_registo),sum(a.valor_total)
  12. from
  13. (select * from fact_conta_cliente where pk_id in
  14. (select id_fact_conta_cliente from fact_factura_conta_cliente where id_factura = 22578115)) a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement