Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.54 KB | None | 0 0
  1. select
  2.     ordini.id as id_ordine,
  3.     items.id as id_prodotto,
  4.     items.prodotto,
  5.     items.pezzi,
  6.     items.qta,
  7.     items.netto_produttore,
  8.     items.imponibile,
  9.     regione
  10. from
  11.     ordini_2014 as ordini
  12. inner join
  13.     ordini_items_2014 as items
  14. on
  15.     ordini.middi = items.middi
  16. inner join (
  17.     select regione from comuni,ordini_2014 where ordini_2014.de_cap = comuni.cap limit 1
  18. ) as regione
  19. where
  20.     ordini.stato in ('CONSEGNATO', 'RIMBORSATO', 'SPEDITO')
  21. and
  22.     ordini.data_ordine between '2019-09-03' and '2019-10-03'
  23. and
  24.     ordini.agente_id = 87061
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement