I'm currently running a query on a db that looks as follows:

   > SELECT field1,field2,field3 FROM table ORDER BY field3 DESC LIMIT 5;

   This produces:

   +--------+---------+------------+
   | field1 | field2  | field3     |
   +--------+---------+------------+
   |      1 | Title 1 | 2004-09-08 |
   |      2 | Title 2 | 2004-10-23 |
   |      3 | Title 3 | 2004-11-11 |
   |      4 | Title 4 | 2004-11-20 |
   |      5 | Title 5 | 2004-11-24 |
   +--------+---------+------------+

My problem is, I need the last two in that list, in the order they're listed there. If I reverse the order (by using ASC), I will get:

   +--------+---------+------------+
   | field1 | field2  | field3     |
   +--------+---------+------------+
   |      5 | Title 5 | 2004-11-24 |
   |      4 | Title 4 | 2004-11-20 |
   |      3 | Title 3 | 2004-11-11 |
   |      2 | Title 2 | 2004-10-23 |
   |      1 | Title 1 | 2004-09-08 |
   +--------+---------+------------+

...which puts the two that I need at the top, but not in the order I need them (I need 20th listed before the 24th).

So, how do I reverse DESC sorting, to get the records in the order that I need?

--
H | I haven't lost my mind; it's backed up on tape somewhere.
+--------------------------------------------------------------------
Ashley M. Kirchner <mailto:[EMAIL PROTECTED]> . 303.442.6410 x130
IT Director / SysAdmin / WebSmith . 800.441.3873 x130
Photo Craft Imaging . 3550 Arapahoe Ave. #6
http://www.pcraft.com ..... . . . Boulder, CO 80303, U.S.A.





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



Reply via email to