Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. (select
  2. ordinidettagli.idCliente as 'idcliente',
  3. ordinidettagli.CodiceArticoloBreve as 'codice',
  4. sum(ordinidettagli.Quantita) as 'qta'
  5. FROM ordiniDettagli
  6. where ordinidettagli.CodiceArticoloBreve ='00001onep0086'
  7. and idcliente ='218'
  8. group by idcliente, codicearticolobreve
  9. )
  10. union
  11. (select
  12. prenotazionidenorm.idCliente as 'idcliente',
  13. prenotazionidenorm.CodiceArticolo as 'codice',
  14. sum(prenotazionidenorm.NumeroCopie) as 'qta'
  15. from prenotazioniDenorm where prenotazionidenorm.CodiceArticolo ='00001onep0087'
  16. and idcliente ='218'
  17. group by idcliente, codicearticolo
  18.  
  19. )
  20. order by qta
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement