Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

group by issue

Status
Not open for further replies.

lelo25

Technical User
Nov 13, 2003
40
LB
Hello ,
I need to execute the following select:
select a,b,(select c,d from e)
group by a,b,(select c,d from e);

with what must i replace the (select c,d from e) in the group by clause .
RGDS.
 
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.

select a,b,c,sum(d),e from table1,table2
where c=e
group by a,b,c,e


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top