MySQL Forums
Forum List  »  Newbie

Re: Sorting by DATE and then by ID when dates are same
Posted by: Huu Da Tran
Date: September 05, 2008 12:15PM

Maybe something like?
select ID
from $newstable
where ((art_date = $art_date) and (id > $id))
    or (art_date > $art_date)
order by art_date, id
limit 1

Huu Da
MySQL flirter

Options: ReplyQuote


Subject
Written By
Posted
Re: Sorting by DATE and then by ID when dates are same
September 05, 2008 12:15PM


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.