Home > OS >  SELECT empty values in snowflake select and count statement
SELECT empty values in snowflake select and count statement

Time:09-18

This is my first time handling a snowflake table, but I have a difficulty selecting empty values in my SQL query.

This is an example table:

enter image description here

I am selecting count of customers whom registrations is NOT TRUE. I used this query:

SELECT count(*) FROM CUSTOMERS WHERE Registered != 'TRUE'

I got only two customers because of empty (NULL) values, then I tried another query with NULLIF to include nulls:

SELECT count(NULLIF(Registered,'')) AS TEST FROM CUSTOMERS WHERE Registered != 'TRUE'

This also did not include the empty values in the total count!

CodePudding user response:

Using enter image description here

  • Related