IN clause
| From: | Bryan | Date: | Tue, 26 Jun 2007 13:01:35 +0000 |
| Subject: | IN clause | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-43717@lists.php.net to get a copy of this message | ||
If I have a SQL statement using the IN clause, how do I keep the order of the list?
Example:
SELECT * FROM table WHERE (number in (5, 9, 3, 4, 1, 7, 2, 8, 6))
How would I pull records in the order of the numbers to list out as:
5 - Record 5
9 - Record 9
3 - Record 3
4 - Record 4
1 - Record 1
7 - Record 7
2 - Record 2
8 - Record 8
6 - Record 6
Thanks so much...