* motorpsychkill 
> SELECT  *  FROM kf_gallery WHERE gallery_id IN ( 3, 1, 2 )  ORDER  BY ?
> 
> What I'm trying to do is get the results in the order specified 
> in the "IN"
> clause, i.e. (3, 2, 1).  Is this possible?  (I'm having trouble searching
> the mail archives).  Thanks!

Use the FIELD() function:

SELECT  *  FROM kf_gallery 
  WHERE gallery_id IN ( 3, 1, 2 )  
  ORDER  BY FIELD(gallery_id, 3, 1, 2)

HTH,

-- 
Roger


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to