Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order by values in delimited List
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Order by values in delimited List
Miscellaneous
Thread ID:
00924189
Message ID:
00924189
Views:
62
Tricky order by clause question. In the snippit of code below, I use a inlist function to determine if a roomID is in the passed list of rooms for selection purposes.
and dbo.meetings.RoomID in (select val from dbo.inlist(@tcDeptList))
ORDER BY  dbo.coRooms.deptdisplayorder,dbo.coRooms.RoomName, dbo.meetings.begintime
Sample List Values
110,110,89,10
This works and gets me the right records. Now I need to change the order by to match the order of the room ID's in the list. Does anyone have a suggestion how I might be able to do that. This code is in a stored procedure currently.

Thanks for any help.
Next
Reply
Map
View

Click here to load this message in the networking platform