azmicolejr

Plain Query

Apr 15th, 2021
531
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2. spk.nama_customer, spk.no_hp, spk.plat_nomor, spk.jenis_mobil, produk.nama_produk, spk_detail.produk_id, spk_detail.harga, spk.tgl_masuk, spk.nota_spk,
  3. pelunasan.no_nota_pelunasan, spk_detail.spk_valid_until as validUntil, spk_detail.spk_maintenance_notes as maintenance_notes
  4. FROM spk
  5. INNER JOIN spk_detail ON spk.id_spk = spk_detail.spk_id
  6. INNER JOIN produk ON spk_detail.produk_id = produk.id_produk
  7. INNER JOIN pelunasan ON spk.id_spk = pelunasan.pelunasan_nota_spk
  8. WHERE spk_detail.spk_valid_until IS NOT NULL
  9. UNION ALL
  10. SELECT
  11. spk.nama_customer, spk.no_hp, spk.plat_nomor, spk.jenis_mobil, produk.nama_produk, pelunasan_detail.produk_id, pelunasan_detail.harga, spk.tgl_masuk, spk.nota_spk,
  12. pelunasan.no_nota_pelunasan, pelunasan_detail.pelunasan_valid_until as validUntil, pelunasan_detail.pelunasan_maintenance_notes as maintenance_notes
  13. FROM pelunasan
  14. INNER JOIN pelunasan_detail ON pelunasan.id_pelunasan = pelunasan_detail.pelunasan_id
  15. INNER JOIN produk ON pelunasan_detail.produk_id = produk.id_produk
  16. INNER JOIN spk ON pelunasan.pelunasan_nota_spk = spk.id_spk
  17. WHERE pelunasan_detail.pelunasan_valid_until IS NOT NULL
  18. ORDER BY nama_customer ASC
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×