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 Link to comment https://forums.phpfreaks.com/topic/227726-in/ 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') Link to comment https://forums.phpfreaks.com/topic/227726-in/#findComment-1174476 Share on other sites More sharing options...
dreamwest Posted February 15, 2011 Author Share Posted February 15, 2011 Thanks Link to comment https://forums.phpfreaks.com/topic/227726-in/#findComment-1174485 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.