Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Order of parameters passed in the "WHERE IN clause" should not change
I have a table named Temp_Table which has 6 rows, like below example:
My query is: [color=Red]Select * from Temp_Table where Col1 in (3,6,1)[/color]
The result which is get is:
[color=Blue] [b]Col1 Col2[/b]
But I am expecting the result to be in the same order of what is passed in the IN clause, like below:
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