tags:

views:

25

answers:

1

Hi,

I have a query that gets a result, limits it and then does a sort around the limited results. Something like:

(SELECT SQL_CALC_FOUND_ROWS * FROM  table ... ORDER BY score DESC LIMIT 0,15) ORDER BY name ASC;

Using

SELECT FOUND_ROWS() AS total

after will always return 15 due to the sub sort. Is there a way around this?

Thanks!

+1  A: 

I'm afraid you'll have to do a COUNT(*) in a separate query.

Quassnoi