NYCPHP Meetup

NYPHP.org

[nycphp-talk] OT: Random MySQL question

Flavio daCosta nyphp at n0p.net
Wed Feb 14 20:58:11 EST 2007


On 02/14/2007 05:14 PM, Jon Baer wrote:
> Interesting how you can walk down the entire list to produce the order
> you need like that.

Yes, and to elaborate a bit more from my earlier post, you could put the
series in the FIELD() and then sort strictly from that.


SELECT
	id, categories
FROM
	dd_categories
WHERE
	id IN (21, 20, 13, 3, 22, 31)
ORDER BY
	FIELD(id, 21, 20, 13, 3, 22, 31);





More information about the talk mailing list