Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL ordering...

Author  Topic 

charlys
Starting Member

3 Posts

Posted - 2001-04-04 : 12:06:35
Hi
Usually when we define a specific order for the records based on some field. (SELECT * FROM users ORDER BY Name), but I have now a request that the output recordset will be ordered in the same order records where entered. Example:

I executed: SELECT name FROM users WHERE name IN ('Joshua','Jhon','Donna','Martel')

The answer was:

NAME
=======
Donna
Jhon
Joshua
Martel

Is there a way to tell the SQL server that I want the output in the same order records where entered on the IN clause ?

Thanks in Advance

Carlos

   

- Advertisement -