morrisoner Posted August 5, 2003 Share Posted August 5, 2003 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) Quote Link to comment https://forums.phpfreaks.com/topic/835-sorting-troubles/ Share on other sites More sharing options...
rhysmeister Posted August 6, 2003 Share Posted August 6, 2003 Try... SELECT * FROM notes, max(date) ORDER BY date DESC Replacing DESC with ASC would obviously reverse the sort. Quote Link to comment https://forums.phpfreaks.com/topic/835-sorting-troubles/#findComment-2785 Share on other sites More sharing options...
morrisoner Posted August 7, 2003 Author Share Posted August 7, 2003 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. Quote Link to comment https://forums.phpfreaks.com/topic/835-sorting-troubles/#findComment-2802 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.