|
-
May 23rd, 2011, 04:22 AM
#1
Thread Starter
Addicted Member
Order results basing on IN Clause.
Hi,
I'd been searching a little about that case but didn˛t find an answer.
I have a query, eg:
Select * from items where itemCode in(32123,321259,12489,45896)
I would like to have a result ordered in the same order in which i put items code to IN clause.
Is that possible? I`ve been thinking about creating programatically in .NET a SQL query made with UNION like:
Select * from items where itemcode = 32123
UNION
Select * from items where itemcode = 321259
etc.
The result will be as expected, but I think this will load a database too much for a bigger amount of items.
Thanks for Your help.
Peter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|