Untested (Obviously as I don't have your schema)

select max(WheverYourIDFieldIs)-count(WhateverYourIDFieldIs) as "Not Used"
from teaInStock group by WhateverYouIDFieldIs

On Tue, Sep 5, 2017 at 3:45 PM, Cecil Westerhof <cldwester...@gmail.com>
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?
>
> --
> Cecil Westerhof
> _______________________________________________
> 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

Reply via email to