SQL Max () question
I am doing this now:
SELECT * FROM messages WHERE location_id = 7 AND date(date) <= date('now', 'localtime') ORDER BY date,revision LIMIT 1
This gives me the latest post with the highest version #.
How do I get all the most recent messages? If I do this:
SELECT * FROM messages WHERE date(date) <= date('now', 'localtime') ORDER BY date,revision
I am still getting messages with lower version numbers.
+2
source to share