Can I run a mysql query starting from the bottom of the table to the top without adding an incrementing column?
I have an history of pages visited by the user and I want to show them with the most recently visited first, and I only record the url, I do not record the time or anything else.
Do I have to add a column with incrementing numbers or something like that or is there a way to run the query from the bottom of the table to the top?
And if I do have to add a column what’s the best choice?
I found this similar question but it doesn’t answer my question but I thought I would link it here:
Scanning a mysql table from the bottom
You should include some kind of order, there is no guarantee that items are ordered in the table in the same order they are inserted.
It’s not an ordered list like excel.
You should add a CreatedDate column, then
ORDER BY CreatedDate DESC