Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. select if(month(date)=12,"Декабрь",if(month(date)=1,"Январь","Што")) month, brand, art_num from (
  2. select o.id, date(date_create) date, pa.id pa_id, br.NAME_BRANDS brand, pa.art_num
  3. from orders o
  4. LEFT JOIN order_cars oc on o.id=oc.order_id
  5. LEFT JOIN order_product op on oc.id=op.car_id
  6. LEFT JOIN prices_all pa on op.price_all_id=pa.id
  7. left join brand_all br on pa.brand_id = br.id
  8. where date_create >= "2019-12-01"
  9. and o.order_delivery_id = 3
  10. and oc.id is not null and op.car_id is not null
  11. ) a group by month, brand, art_num
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement