Jump to content


Photo

sorting troubles


  • Please log in to reply
2 replies to this topic

#1 morrisoner

morrisoner
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationSydney, Australia

Posted 05 August 2003 - 09:42 AM

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)

#2 rhysmeister

rhysmeister
  • Members
  • PipPipPip
  • Advanced Member
  • 51 posts
  • LocationEngland

Posted 06 August 2003 - 08:32 AM

Try...

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

Replacing DESC with ASC would obviously reverse the sort.

#3 morrisoner

morrisoner
  • New Members
  • Pip
  • Newbie
  • 2 posts
  • LocationSydney, Australia

Posted 07 August 2003 - 12:11 AM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users