Subject | Optimizing a subquery |
---|---|
Author | kokok_kokok |
Post date | 2006-07-13T12:34:02Z |
I need to do:
select CustomerId, Sales, (select sum(Sales) from Customers) as Total
from Customers
It works fine, but for each row, Firebird executes the subquery
"select sum(Sales) from Customers".
Is there a way to optimize the plan?
Thank you
select CustomerId, Sales, (select sum(Sales) from Customers) as Total
from Customers
It works fine, but for each row, Firebird executes the subquery
"select sum(Sales) from Customers".
Is there a way to optimize the plan?
Thank you