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.
| Author |
Topic |
|
andrewcw
Posting Yak Master
133 Posts |
Posted - 2005-06-02 : 20:46:19
|
| I have a data that I need to sum by group and then order.eg. SELECT Customer, SUM(Elapsedsecs) AS SystemTimeFROM dbo.TestBlockStatusTestWHERE (SystemName = 'foo')GROUP BY CustomerOK Now I need to order the above....This wont work: Select * from ( SELECT Customer, SUM(Elapsedsecs) AS SystemTime FROM dbo.TestBlockStatusTestWHERE SystemName = 'foo' GROUP BY Customer ) order by SystemTimeThanks !!!andrewcw |
|
|
Merkin
Funky Drop Bear Fearing SQL Dude!
4970 Posts |
Posted - 2005-06-02 : 20:53:12
|
| SELECT Customer, SUM(Elapsedsecs) AS SystemTimeFROM dbo.TestBlockStatusTestWHERE (SystemName = 'foo')GROUP BY CustomerORDER BY SUM(ElapsedSecs)?DamianIta erat quando hic adveni. |
 |
|
|
andrewcw
Posting Yak Master
133 Posts |
Posted - 2005-06-02 : 21:02:01
|
| Thats what I needed ! That was quick you all are great !andrewcw |
 |
|
|
|
|
|