I have a complex MYSQL query which I run from multiple sources of data and that can be ordered depending on the request ( so record id is not much help ).
I want to add a unique ID column at the completion of the data each time the query is run so I can enable pagenation capability of the data.
If I was doing this at the database level I could use id INTEGER AUTO_INCREMENT but this is about doing the addition on the fly every time a query has run.
You can do this:
However, you can use the MySQL built in function
LIMIT: