In the following query:
SELECT column1,column2 FROM table1 ORDER BY column1 LIMIT 0,30
How can I find out the number of rows that would have been returned were it not for the LIMIT?
Edit: I am looking for a way to work this into the query above and not do a separate query. (If possible.)
If you do this query:
You can retrieve the number of rows the previous SELECT found with
If you really must do it with one query, you’ll have to use a sub select (which’ll have the disatvantage of adding an extra column to every row..)