Subject | Order By with In Operator Question |
---|---|
Author | devincayce |
Post date | 2006-10-02T18:34:20Z |
This is a general sql question, but if I have a query like this:
SELECT * FROM mytable WHERE idnum IN ('203', '102', '355')
How do I get the returned recordset to be in the order of the records with the IDs listed in the
"IN" statement like this
Record 1 idnum = 203
Record 2 idnum = 102
Record 3 idnum = 355
When I have tried it so far I get an order other than that.
SELECT * FROM mytable WHERE idnum IN ('203', '102', '355')
How do I get the returned recordset to be in the order of the records with the IDs listed in the
"IN" statement like this
Record 1 idnum = 203
Record 2 idnum = 102
Record 3 idnum = 355
When I have tried it so far I get an order other than that.