Hi,
Its better to do the grouping inside the pseudo table query.
ie.
select a,b,c,sum_d
from table1,
(select sum(d) sum_d,e from table2) alias_table2
where c=e (or whatever the condition is)
The simple query looks like the one below,but it 'll take more time to execute as the columns increses...