Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT a.id, a.cos_id, b.trx_name AS trxName, a.trx_number AS trxNumber, a.trx_date AS trxDate, c.bpart_name AS customerName,
  2.        d.currency_code AS currencyCode, a.val, e.trx_name AS refTrxName, a.ref_trx_number AS refTrxNumber, a.ref_trx_date AS refTrxDate, a.trx_dscr AS trxDscr
  3. FROM eart010 a
  4.     LEFT JOIN bmas010 b ON b.id = a.trx_code_id
  5.     LEFT JOIN emsm633 c ON c.id = a.cust_id
  6.     LEFT JOIN bmas110 d ON d.id = a.curr_id
  7.     LEFT JOIN bmas010 e ON e.id = a.ref_trx_code_id
  8. WHERE a.cos_id = '4e2b424769d54cac082299a4f3dd5640'
  9.   AND a.trx_yrmo BETWEEN '201801' AND '201907'
  10.  
  11. UNION ALL
  12.  
  13. SELECT a.id, a.cos_id, b.trx_name AS trxName, a.trx_number AS trxNumber, a.trx_date AS trxDate, c.bpart_name AS customerName,
  14.        d.currency_code AS currencyCode, a.val, e.trx_name AS refTrxName, a.ref_trx_number AS refTrxNumber, a.ref_trx_date AS refTrxDate, a.trx_dscr AS trxDscr
  15. FROM eart020 a
  16.     LEFT JOIN bmas010 b ON b.id = a.trx_code_id
  17.     LEFT JOIN emsm633 c ON c.id = a.cust_id
  18.     LEFT JOIN bmas110 d ON d.id = a.curr_id
  19.     LEFT JOIN bmas010 e ON e.id = a.ref_trx_code_id
  20. WHERE a.cos_id = '4e2b424769d54cac082299a4f3dd5640'
  21.   AND a.trx_yrmo BETWEEN '201801' AND '201907'
  22. ORDER BY trxName, trxDate, trxNumber
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement