-----Original Message-----
From: Mark W. Breneman
Sent: Tuesday, March 09, 2004 1:24 PM
To: CF-Talk
Subject: SQL custom Order by

>  I doubt this is possible, but is there a way to do a custom order by
based
> on the order I provide?  I need the SQL results to be in a specific order
> based on the "catID", but not in ascending or descending order. The order
> that I want them in is 10,3,5,1,7,4,9,2,6,8.


(Not sure this is possible in Sql Server, cause I don't use that).


I would write a custom function to do this.  So you would do:


select catID, mysort(catID) srt
from foo
order by srt;


In the function, just return what order you want given the catId.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to