Re: IN clause

From: Date: Wed, 27 Jun 2007 02:37:04 +0000
Subject: Re: IN clause
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-43724@lists.php.net to get a copy of this message
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/

« previous php.db (#43724) next »