Jump to content

Archived

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

morrisoner

sorting troubles

Recommended Posts

Hi i have a simple search engine which lists things in categories. By subject, topic, sub-topic and then the school notes.

I can sort the individual notes by themselves according to date. But I can not sort the categories. I thought of something like:

SELECT * FROM notes, max(date) ORDER BY max(date)

Share this post


Link to post
Share on other sites

Try...

 

SELECT * FROM notes, max(date) ORDER BY date DESC

 

Replacing DESC with ASC would obviously reverse the sort.

Share this post


Link to post
Share on other sites

yep thanx that worked great.

Just for reference for other people i needed to add a GROUP BY in the query for it to work.

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.