Subject Optimizing a subquery
Author kokok_kokok
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