Right now I'm doing this:
SELECT * FROM messages WHERE location_id = 7 AND date(date) <= date('now', 'localtime') ORDER BY date,revision LIMIT 1
This gives me the most recent message, with the highest revision #.
How can retrieve all of the most recent messages? If I do:
SELECT * FROM messages WHERE date(date) <= date('now', 'localtime') ORDER BY date,revision
I still get messages with lower revision numbers.