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)
 Decending order

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-22 : 22:02:18
Gary Costigan writes "I have created a survey on a web page that dumps the results into a SQL 7 table. My query using the SUM function totals each column and displays the results. My question is how do I display the results in a decending order?

Here is my query: select (Sum (lpwebsite)) as DFWWebsite, (sum(LPMarlinBoards)) as MarlinBoards, (sum(LPSabreStars)) as SabreStars, (sum(LPEMail)) as EMail, (sum(LPMemoInMailbox)) as Memoinmailbox, (sum(LPSAI)) as SAI, (sum(LPHI6)) as HI6, (sum(LPOtherBulletinBoards)) as OtherBulletinBoards, (sum(LPVideotapes)) as VideoTapes, (sum(LPInsideDFW)) as InsideDFW, (sum(LPSabreSineIn)) as Sabresinein, (sum(LPVideoOnTheWeb)) as VideoOnTheWeb
from password

Here are the results:

DFWWebSite MarlinBoards SabreStars
6 1 1

EMail Memoinmailbox SAI HI6
0 4 5 0

OtherBulletinBoards VideoTapes InsideDFW Sabresinein
1 0 0 0

VideoOnTheWeb
0

I have tried the Order By but can't seem to make it work because of the SUM Function.

Thanks

Gary Costigan
Dallas, Tx."
   

- Advertisement -