Wed 12 Apr 2006
NULL values and NOT EQUALS operator
Posted by Shane under Oracle, SQL Server, SQL Tricks
Some food for thought when working with NULL values.
select count(*)
from ps_dwsa_prog_dtl
COUNT(*)
----------
657662
1 row selected
select count(*)
from ps_dwsa_prog_dtl
where acad_sub_plan ='13'
COUNT(*)
----------
13
1 row selected
select count(*)
from ps_dwsa_prog_dtl
where acad_sub_plan <>‘13′
COUNT(*)
———-
148559
1 row selected
select count(*)
from ps_dwsa_prog_dtl
where acad_sub_plan is null
COUNT(*)
———-
509090
1 row selected