I have 100 records in a sql table
can I get the total number of records in single query with limits applied
like ..
SELECT * , COUNT(*) as records form table offset 0 limit 10.
So the records will have value 100. Is possible some how ?
I have 100 records in a sql table
can I get the total number of records in single query with limits applied
like ..
SELECT * , COUNT(*) as records form table offset 0 limit 10.
So the records will have value 100. Is possible some how ?
Use a correlated subquery:
SELECT * , (SELECT COUNT(*)
from table) as records
form table
offset 0 limit 10;
But it would be better to do only one separate query for this count, then from your front end application display it the way you want, instead of doing it 100 times.