I have a following query which gets data and shows as in Image below,
SELECT
TICKETS.TICKETID AS TICKET_NO,
RECEIPTS.DATENEW AS TICKET_DATE,
PAYMENTS.TOTAL AS MONEY,
CUSTOMERS.NAME AS CUSTOMER,
PAYMENTS.PAYMENT AS PAYMENT
FROM RECEIPTS
LEFT JOIN TICKETS ON RECEIPTS.ID = TICKETS.ID
LEFT JOIN PAYMENTS ON RECEIPTS.ID = PAYMENTS.RECEIPT
LEFT JOIN CUSTOMERS ON TICKETS.CUSTOMER = CUSTOMERS.ID
LEFT JOIN ADJUSTMENTS ON CUSTOMERS.ID = ADJUSTMENTS.CUSTOMER_ID
ORDER BY TICKETS.TICKETID
I have another table called ADJUSTMENTS having fields
ID CUSTOMER_ID ADJUSTMENT_AMOUNT ADJUSTMENT_REASON DATE
What I need is to pick up ADJUSTMENT_AMOUNT and DATE and place them exactly inside that table (shown in image) as an individual entry (ROW). I used UNION but what it did was to duplicate the entry and wasn't able to show that right under/within these rows but as a separate column. How can I do it?
This is the desired table I want to access from both tables