You can do this with a subquery:
select *, (select count(*) from mytable) as total from mytable LIMIT 0,10
But I do not think this has any advantage.
edit: As Ilya said, the total counter and the lines have a completely different meaning, there is no real goal in getting this data in the same query. I will stick with two requests. I simply gave this answer, showing that it is possible, and not that it is a good idea.
krtek
source share