Very basic question?
How to count the rows in a table where column != 'SOME VALUE'
Here is the situation: The apps table have 21 rows.
5 rows with category = 'CORE' and rest category is null.
SQL> select count(*) from apps ;
SQL> select count(*) from apps where category ='CORE' ;
SQL> select count(*) from apps where category != 'CORE' ;
0 ... why the answer is not 16
Rest of the values in the table are nulls. This is suppose to be
a simple query. Why the result is not 16 ( 21 -5). Is there any
different way to treat nulls ?
I used following tow work around to get correct answer.... but is there any standard way to treat these nulls.
1 select count(*) from apps where category != 'CORE'
or category is NULL ;
2 select count(*) from apps where 'ABCDEFG' =