Advertisement
Guest User

Untitled

a guest
Dec 13th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. SELECT o.order_id as order_id,
  2. oi.NAME as nama_produk,
  3. o.quantity as order_qty,
  4. sch.NAME as nama_sekolah,
  5. sch.address as alamat_sekolah,
  6. sch.city as kota_sekolah,
  7. sch.province as provinsi_sekolah,
  8. sch.zip_code as kode_pos_sekolah,
  9. sch.npsn as npsn,
  10. sch.phone as telepon_sekolah,
  11. sch.npwp as npwp_sekolah,
  12. sch.email as email_sekolah,
  13. cust.NAME as pic_sekolah,
  14. cust.npwp as pic_npwp,
  15. cust.phone as telepon_pic,
  16. o.amount as amount,
  17. (coalesce('NULL')) as no_so_dropship,
  18. (coalesce('NULL')) as no_po_dropship,
  19. o.status,
  20. o.payment_status
  21. FROM order_items oi
  22. INNER JOIN orders o
  23. ON o.order_id = oi.order_id
  24. INNER JOIN users cust
  25. ON o.customer_id = cust.id
  26. INNER JOIN schools sch
  27. ON sch.id = cust.school_id
  28. WHERE o.merchant_id = 'STGL-0003'
  29. ORDER BY o.created_date asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement