Re: Adhoc sorting requirement

2009-07-05 Thread Ravindra Harige
>> >> -Original Message- >> From: Nathan Sullivan >> Sent: Thursday, July 02, 2009 1:07 PM >> To: 'Ravindra Harige'; mysql@lists.mysql.com >> Subject: RE: Adhoc sorting requirement >> >> Ravindra, >> >> Maybe something like th

Re: Adhoc sorting requirement

2009-07-02 Thread Ravindra Harige
p, interval 2 day))) then 3 > else 4 > end, date_field_3, date_field_2, date_field_1; > > -Original Message- > From: Nathan Sullivan > Sent: Thursday, July 02, 2009 1:07 PM > To: 'Ravindra Harige'; mysql@lists.mysql.com > Subject: RE: Adhoc sorting requirement &

RE: Adhoc sorting requirement

2009-07-02 Thread Nathan Sullivan
27;; mysql@lists.mysql.com Subject: RE: Adhoc sorting requirement Ravindra, Maybe something like this? order by case when (date_field_1 between date(current_timestamp) and date(date_add(current_timestamp, interval 2 day))) then 1 when (date_field_2 between date(current_timestamp) and dat

RE: Adhoc sorting requirement

2009-07-02 Thread Nathan Sullivan
, 2009 12:18 PM To: mysql@lists.mysql.com Subject: Adhoc sorting requirement Hi, I have a very ad hoc sorting requirement and would like to know how this can be achieved. The requirement is as follows: I have a table (of say 100 records) with 3 DATE fields: date_field_1 , date_field_2 , date_field_3 I

Adhoc sorting requirement

2009-07-02 Thread Ravindra Harige
Hi, I have a very ad hoc sorting requirement and would like to know how this can be achieved. The requirement is as follows: I have a table (of say 100 records) with 3 DATE fields: date_field_1 , date_field_2 , date_field_3 I have a date range, for eg. from (today) to (today+2) and Each one of th