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)
 COMPUTE BY

Author  Topic 

sica
Posting Yak Master

143 Posts

Posted - 2001-11-02 : 11:30:45
I have a compute clauses like this one:

SELECT type, price, advance
FROM titles
ORDER BY type
COMPUTE SUM(price), SUM(advance)

The result is :
type price advance
------------ --------------------- ---------------------
business 19.9900 5000.0000
business 11.9500 5000.0000
business 2.9900 10125.0000
.
.
.
trad_cook 20.9500 7000.0000
trad_cook 11.9500 4000.0000
trad_cook 14.9900 8000.0000
UNDECIDED NULL NULL

sum
===================
236.2600

sum
===================
95400.0000


I want to use an alias on SUM.Is this possible?
Do I have to use a temp table ?


Thanks!

Sica

   

- Advertisement -