Subject | Re: SubQuery Help |
---|---|
Author | E. D. Epperson Jr |
Post date | 2014-09-16T16:12:30Z |
I'd recommend using a left join with table alias.
Example
--
Select
a.Project_PK
a.Project_PK
, SUM(b.cost) AS Sum_of_Cost
, SUM(b.estimate_cost) AS Sum_of_Estimated_Cost
, SUM(c.quantity) AS Sum_of_Quantity
, SUM(c.estimate_quantity) AS Sum_of_Estimated_Quantity
FROM Projects a
LEFT JOIN Cost b ON a.project_pk = b.project_pk
LEFT JOIN Quantity c ON a.project_pk = c.project_pk
Dixon Epperson