[thelist] SQL order by
Drew Shiel
ashiel at sportsinteraction.com
Fri Feb 7 09:05:00 CST 2003
[Using MS SQL Server, I think v7.0 or so]
I have SQL as follows:
SELECT EventCategory.EventCategoryID, EventCategory.EventCategory,
EventType.EventTypeID, EventType.EventType, [snip many more], FROM
EventCategory (nolock), EventType (nolock) where
(EventCategory.Eventcategoryid = EventType.EventCategoryID) AND
EventType.EventTypeHeadline <> '' AND EventCategory.EventCategoryID in
(6,5,7,8,10,11,12,13,14,16,17 ) order by EventCategory.EventCategory,
EventType.EventType
Now, the important bit for this question is:
EventCategory.EventCategoryID in (6,5,7,8,10,11,12,13,14,16,17 )
where the numbers are not in numeric order.
Even if I remove the "ORDER BY" part, the results come out in numeric
order. Is there any way to preserve the order I have set (6,5,7, etc)?
(The order isn't very different in this version, and it's not frightfully
urgent. In future versions, however, I may want vastly different ones, like
17,2,5,11,6... )
Cheers,
Drew.
Drew Shiel webmaster at swiftpay.com
+353-1-2365705
------------------------------------------------------------------
Swiftpay -- The best way to pay online -- http://www.swiftpay.com
More information about the thelist
mailing list