MySQL Forums
Forum List  »  Newbie

Re: Two types of sorting into one request
Posted by: Adrian Cristian
Date: June 24, 2005 11:19PM

The problem is that I don't have version 4..

It is on a rental server and I can not install it..

Isn't any other mode for doing this?!

Someone had suggested this:

select id
, name
, weith
, data
from yourtable
order
by /* 1st sort column is ASC */
case when data > date_sub(current_date, interval 30 day)
then weith
else 937 end ASC
, /* 2nd sort column is DESC */
data DESC
, /* 3rd sort column is ASC */
case when data > date_sub(current_date, interval 30 day)
then 937
else weith end ASC

but I see that it doesn't sort .. first by weith..and after that by date..

Options: ReplyQuote


Subject
Written By
Posted
Re: Two types of sorting into one request
June 24, 2005 11:19PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.