Thursday, September 6, 2012

Counting the results of LIMITED SQLite query

If you try to run the following query to get the count of the results which might be less than 100


SELECT count(*)  FROM TABLE  LIMIT 100, 200

You will get the count of the full table - regardless of the limit

The solution

SELECT COUNT(*) FROM  (SELECT *  FROM TABLE  LIMIT 100, 200 )


No comments:

Post a Comment