dreamwest Posted February 15, 2011 Share Posted February 15, 2011 Is there a way i can set IN() to return rows in order aka from left to right Table: id name 2 amazing 12 video 15 funny example query: SELECT id FROM table WHERE name IN('funny','amazing','video') Which out puts: 2 12 15 What i need the output to be is 15 2 12 Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted February 15, 2011 Share Posted February 15, 2011 Use - ORDER BY FIELD(name,'funny','amazing','video') Quote Link to comment Share on other sites More sharing options...
dreamwest Posted February 15, 2011 Author Share Posted February 15, 2011 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.