If I'm going to be selecting from a table where i may get multiple rows but want only the the one with the latest timestamp, is there a way to do this with the SQL rather than selecting all and processing the results with PHP?
Query would look like this:
SELECT * FROM table WHERE identifier = '23';
A timestamp is included in each row and I'd just like the row with the latest timestamp.
Possible to do just on the SQL side?
Many thanks!
Nick
SELECT * FROM table WHERE identifier = '23' order by timestamp_field desc limit 1;
Sheeesh! What an idiot!
Here's me, as usual, making life complicated for myself when there's a perfectly simple and (should have been) obvious solution ;)
Not sure on MAX - MySQL....
Thanks very much indeed guys..
Nick