Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Work around for using nested aggregate functions

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-02-07 : 10:15:55
Mario writes "SQl Server does not allow you to nest aggregate functions fro e.g.

select sum( avg(amount) ) from table1 group by dateUsed

whats the work around o achieve this"

Nazim
A custom title

1408 Posts

Posted - 2002-02-07 : 10:32:29
How About this one

select dateused,Sum(avamt)
(select dateused,avg(amount) avAmt from table1 group by dateUsed) as Test

HTH


--------------------------------------------------------------
Dont Tell God how big your Problem is , Tell the Problem how Big your God is
Go to Top of Page
   

- Advertisement -