[thelist] SQL ORDER BY

Rickards, Julian (NDM) julian.rickards at ndm.gov.on.ca
Thu Apr 20 13:44:58 CDT 2006


To the best of my knowledge, the only options for Order by is Ascending or Descending. The only way I can think of to do what you want is to have three queries and use the WHERE Class=Open (Close and Suspended) as the separation of the three classes but that will result in all of Class=Open followed by all Class=Close followed by all Class=Suspended. If this meets your needs, it might be something to consider.

The other possibility is to possibly modify the data so that Open is changed to 1Open, Close to 2Close and Suspended to 3Suspended and this will solve the order by issue immediately.

-----Original Message-----
 
In asp when you do a Select statement - is there anyway to have it ORDER BY specific words in a column?  
In the class column it says Open or Close or Suspended.  With a Select statement can I tell it to ORDER BY Class  - Open then Close then Suspended?



More information about the thelist mailing list