Print Page | Close Window

SQL order by

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=2191
Printed Date: 30 March 2026 at 12:10am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: SQL order by
Posted By: Gullanian
Subject: SQL order by
Date Posted: 27 April 2003 at 3:00am

Hi guys, I wrote a quiz script, I need to do a scoreboard for this quiz.  Two elements, score and time.  How do I order by score, if scores are equal order by time?  So the highest score with lowest time is at top

So two people got 9 as a score, the person with the lowest time would be above the person with the same score.




Replies:
Posted By: TYSON
Date Posted: 27 April 2003 at 7:22am

The below works in SQL server, the first column in the ORDER BY is sorted first.

SELECT Score, Time FROM table ORDER BY Score DESC, Time ASC

 



-------------
http://www.fuo-motorsports.com/ - http://www.fuo-motorsports.com/


Posted By: Gullanian
Date Posted: 27 April 2003 at 5:51pm
Thanks!



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net