Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Order by values in delimited List
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Order by values in delimited List
Divers
Thread ID:
00924189
Message ID:
00924189
Vues:
61
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.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform