Re: Reversing DESC|ASC

2004-11-29 Thread SGreen
You seem to be confused in your posting. Your first list is in ASC order and appears correct. Your second list seems to be in DESC order and also seems to be correct. Why is it your results need to have '2004-11-20' pretend to be AFTER '2004-11-24' so that it appears first in a descending

Reversing DESC|ASC

2004-11-26 Thread Ashley M. Kirchner
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 |

Re: Reversing DESC|ASC

2004-11-26 Thread Jigal van Hemert
- Original Message - From: Ashley M. Kirchner [EMAIL PROTECTED] SELECT field1,field2,field3 FROM table ORDER BY field3 DESC LIMIT 5; 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:

Re: [MySQL] Re: Reversing DESC|ASC

2004-11-26 Thread Ashley M. Kirchner
Jigal van Hemert wrote: You can cheat a bit and use a UNION of one SELECT: (SELECT field1,field2,field3 FROM table ORDER BY field3 ASC LIMIT 2) ORDER BY field3 DESC; This didn't work as expected. First, I need DESC sorting instead of ASC to get what I need: SELECT field1,field2,field3

Re: [MySQL] Re: Reversing DESC|ASC

2004-11-26 Thread Jigal van Hemert
From: Ashley M. Kirchner Jigal van Hemert wrote: You can cheat a bit and use a UNION of one SELECT: (SELECT field1,field2,field3 FROM table ORDER BY field3 ASC LIMIT 2) ORDER BY field3 DESC; This didn't work as expected. Very odd! These are my results on MySQL 4.0.21 using InnoDB

Re: [MySQL] Re: Reversing DESC|ASC

2004-11-26 Thread Ashley M. Kirchner
Jigal van Hemert wrote: These are my results on MySQL 4.0.21 using InnoDB tables (it was suitable data for this test, InnoDB was used for other reasons): rpm -qa | grep -i mysql MySQL-server-4.1.7-0 MySQL-devel-4.1.7-0 MySQL-client-4.1.7-0 MySQL-shared-compat-4.1.7-0