skip to Main Content

All joined subquery results return null – Postgresql

I am trying to get all customers with their latest payment transaction, including customers without any transaction: SELECT c.customer_id, c.phone_number, c.email , p.transaction_no, p.amount, p.transaciton_datetime FROM tbl_customers c LEFT JOIN ( SELECT customer_id, transaction_no, amount, transaciton_datetime FROM tbl_payment_transactions ORDER BY…

VIEW QUESTION
Back To Top
Search