I have a query where the SELECT has an additional content prior the FROM:
SELECT p.ItemLookupCode, p.Cost, COALESCE(SUM(c.Cost),0) FROM item p LEFT JOIN item c ON c.ParentItem = p.ID
I have placed all contents after the FROM in the QRP respective location.
Where do I place the "COALESCE(SUM(c.Cost),0)" ?