On 9/5/2017 4:05 PM, Igor Tandetnik 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?

It's possible I misunderstand what it is the OP is trying to do. But in any 
case, the query I show is equivalent to the query the OP has shown (which, 
apparently, does what they want), except formulated in a less roundabout way.
Igor Tandetnik

sqlite-users mailing list

Reply via email to