Hi Froestel,
Thanks, this is helpful, but I'm worried that in the future I may want to expand on the query to join on other related tables as well.
For instance:
Code:
SELECT
i.*,
(SELECT SUM(PMT_AMOUNT) FROM INVOICE_PAYMENTS p WHERE p.INVOICE = i.INVOICE),
(SELECT SUM(FND_AMOUNT) FROM INVOICE_FUNDS f WHERE f.INVOICE = i.INVOICE AND f.FUND = 2)
FROM INVOICES i
Which then breaks this case, as I wouldn't be able to create a criteria on both funds and payments.
Any idea on how to solve this case?
Thanks,
Tim