I would like to know if this is possible using a mysql query:
I have a table called updates.
In the updates table I have 2 columns, id
and timestamp
.
I have 5 rows each with the same id
but with different date timestamps. An example of this timestamp would be the value: 2012-08-04 23:14:09
.
I would like to select only the most recent timestamp value out of the 5 results. This could also be explained by saying that I would like to select the value that is closest to the current date and time. How could I do this?
SELECT id, timestamp FROM updates ORDER BY timestamp DESC LIMIT 1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With