On behalf of Cecil, the fault in that logic is that count(*) returns the number of rows in that table, not whether there is a hole "somewhere: Your query will either return 1, or, 0.
On Tue, Sep 5, 2017 at 3:55 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 9/5/2017 3:45 PM, Cecil Westerhof wrote: > >> It is not very important, but I am just curious. I need to know how many >> records are not yet used. I do that with: >> SELECT COUNT(*) - COUNT("Last Used") AS "Not Used" >> FROM teaInStock >> >> Is that the correct way, or is there a better way? >> > > Why not be explicit about what you are trying to do? > > select count(*) from teaInStock where "Last Used" IS NULL; > > -- > Igor Tandetnik > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users