Oracle

Moderators: None (Apply to moderate this forum)
Number of threads: 348
Number of posts: 673

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Order of parameters passed in the "WHERE IN clause" should not change Posted by Nancy4444 on 20 Mar 2009 at 4:02 AM
Hi All,

I have a table named Temp_Table which has 6 rows, like below example:

Col1 Col2
1 AAAA
2 BBBB
3 CCCC
4 DDDD
5 EEEE
6 FFFF


My query is: Select * from Temp_Table where Col1 in (3,6,1)
The result which is get is:
Col1 Col2
1 AAAA
3 CCCC
6 FFFF


But I am expecting the result to be in the same order of what is passed in the IN clause, like below:
Col1 Col2
3 CCCC
6 FFFF
1 AAAA


How can i do this with a SQL query, am i going wrong with using the IN clause. Please help me solve this issue, I am a c# developer with very little knowledge about query... And I am using SQL Server

Thanks,
Nancy



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.