A the title says, I’m looking for a way to sort a set of rows from a MySQL table.
I’ve simplified my example a bit, but the resulting solution should apply to my exact setup as well.Here’s my setup:
events
----------
event_name
created
updated
Event A
12-09-2012
14-09-2012
Event B
12-09-2012
-
Event C
09-09-2012
13-09-2012
I’m looking for a way to sort the rows based on most recent ‘activity’, so whichever date is the newest. So with the above values, the result should be A, C, B. (from most recent to older). It is worth noting that I can’t change anything about the tables.
How would I go around doing this?
Regards,
Wouter
I think I might be on to something here…
This does seem to work, but I’ll have to do some testing to see if it is foolproof.