He is trying to make it more efficient, so stop counting if count > X. So setting the count after having counted the whole lot won't help.
RBS On Sun, Oct 16, 2011 at 2:46 PM, Simon Slavin <slav...@bigfraud.org> wrote: > > On 16 Oct 2011, at 1:21pm, Fabian wrote: > >> 2011/10/16 Frank Missel <i...@missel.sg> >> >>> What do you want to attain with the count? >> >> I want to allow users to paginate through a result set. The pages are >> retreived through LIMIT/OFFSET, but to calculate the total number of pages, >> I have execute a separate COUNT() query (without LIMIT) once. > > You're using a programming language. So do this: > > numberOfRows = SELECT count(*) FROM myTable > if (numberOfRows > 100) then numberOfRows = 100 > > Simon. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users