i tried this query
SELECT DISTINCT notes.topic, max(date) FROM notes LEFT JOIN subjects ON notes.subjectID = subjects.subjectID WHERE 1 AND notes.subjectID=6 GROUP BY topic ORDER BY date DESC
but it doesnt seem to order them properly
I also tried this but i get an error
SELECT DISTINCT notes.topic FROM notes LEFT JOIN subjects ON notes.subjectID = subjects.subjectID WHERE 1 AND notes.subjectID=6 GROUP BY topic ORDER BY max(date)