= a.project_pk
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com]
Sent: 16 September 2014 08:45 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: SubQuery Help
>Select
> a.Project_PK
>, SUM(b.cost) AS Sum_of_Cos
>Select
> 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.p
Thanks everybody. I'll try it out.
, September 16, 2014 6:38 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Re: SubQuery Help
Yes it does. I posted a correction but apparently it never made it
Dixon
[Non-text portions of this message have been removed]
2014 12:16 PM
(GMT-05:00) To: firebird-support@yahoogroups.com Subject:
Re: [firebird-support] Re: SubQuery Help
I think this needs a
GROUP BY a.Project_PK
With regards,
Martijn Tonies
Upscene Productions
http://www.upscene.com
Download Database Workbench for Oracle, MS SQL Server, Sy
, September 16, 2014 6:12 PM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Re: SubQuery Help
I'd recommend using a left join with table alias.
Example
Select
a.Project_PK
, SUM(b.cost) AS Sum_of_Cost
, SUM(b.estimate_cost) AS Sum_of_Estimated_Cost
, SUM(c.quantit
Sorry, forgot to add the group by statement
so it should be like this:
Select
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 O
I'd recommend using a left join with table alias.
Example
Select
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_p