I simply want to spit out the 5 most recent rows created (IDs) so I may compare to another database for an insert and update on duplicate via php:
SELECT MAX(ID), MAX(DATE) from table ORDER BY ID LIMIT 5
Should spit out something like this:
ID DATE
4018 2012-03-01
4017 2012-03-01
4016 2012-02-25
4015 2012-02-15
4014 2012-02-11
Use a
DESCsort to get the highest values first. I’m assuming that your IDs are created incrementally…