Jump to content

Archived

This topic is now archived and is closed to further replies.

Mutley

Order by 2 rows?

Recommended Posts

I'm wanting to order my news by date but if 3 articles are posted on 1 day, they arn't in order of time. So how do I order by id (each time it is submitted it is given an ID, latest news = biggest ID number).

Something like this:

[code]ORDER BY date DESC && ID DESC LIMIT 1[/code]

Thanks.

Share this post


Link to post
Share on other sites
ORDER BY date DESC, ID DESC LIMIT 1

ahh... beaten.  Good one, Jenk... but at least my example shows that you can sort both ASC/DESC.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.