As I understand the requirements, he wants to find out how many entries (Not which entries) don't exist between the first ID (Assumed 1) and max ID value. So if he's got 3 rows, but max ID is 5, the result should be 2.
But I also suspect you're better in tune with the requirements, since I suspect this had something to do with another thread that I barely was paying attention to. On Tue, Sep 5, 2017 at 4:05 PM, Igor Tandetnik <i...@tandetnik.org> wrote: > On 9/5/2017 4:00 PM, Stephen Chrzanowski wrote: > >> select count(*) from teaInStock where "Last Used" IS NULL; >>> >> >> 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. >> > > What is this "hole" of which you speak? This query can very well report a > number other than 1 or 0. > > count(*) returns the number of rows satisfying the condition in the WHERE > clause; in this case, the number of rows having NULL in "Last Used" column. > In what way do you believe this fails to satisfy the OP's requirements? > > -- > 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