|
|||||||||||
|
Sort results by order in list
From: Papalagi Pakeha <papalagi.pakeha(at)gmail.com>
Date: Mon Oct 29 2007 - 23:53:37 EDT
I have a query like:
+-------+---------------------+| s3x6 | 2007-10-07 08:58:20 | +-------+---------------------+ How can I get the results sorted by the order in which they appear in the ID list? Indeed I could do it in the application but prefer to get the results in the right order from MySQL as the ID list may be long and I may need only first few entries cropped by LIMIT clause. Ideally it should ORDER BY DATE(start_date) DESC and then by the ID list. Do I need some sort of stored function for that? I.e. the ideal output would be: +-------+---------------------+| sxmns | 2007-10-06 02:17:30 | +-------+---------------------+ Thanks PaPa -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql?unsub=lists@pantek.comReceived on Mon Oct 29 23:54:26 2007 This archive was generated by hypermail 2.1.8 : Thu Jul 03 2008 - 08:43:15 EDT |
||||||||||
|
|||||||||||