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.
| Author |
Topic |
|
forefj
Starting Member
10 Posts |
Posted - 2012-05-14 : 14:30:25
|
| I have a Query with a long list of values (hundreds). I need to have the values returned in the order they are entered into the query,if possible.For example:SELECT columnFROMTableWhere In (Value1,Value2,Value3,Value4,Value5)I would like for the return values to be displayed in the order they are listed in the query. The standard Order By Column will not work becausethe values are returned in alphabetical order, in this case I need them to be returned as listed in the query. Can this be done? If so can you show me how. Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2012-05-16 : 05:34:03
|
| or store values in a temp table that has identity column. Use join and order by identity columnMadhivananFailing to plan is Planning to fail |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-16 : 20:55:19
|
| i would prefer temp table solutions especially if number of values involved are large------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|