Bryan wrote:
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))

Try

SELECT * FROM table WHERE (number in (5, 9, 3, 4, 1, 7, 2, 8, 6)) ORDER BY 5, 9, 3, 4, 1, 7, 2, 8, 6;

No idea if that will work ;)

--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to