Subscribe:

Sunday, October 2, 2011

Is null operator


COMPARE NULL IN SQL
If you want to find out if a column contains any null values, then you can use the is NULL operator in the where clause.
A null value means that the value is unavailable. You cannot test for null values using an equal sign, because a Null value cannot be equal for unequal any value.
For example you want to retrieve the names of employees who do not have a manager . you can use the IS NULL operator to find all rows that contain a null value in the MGR column.

SQL> select ename
    from emp
    where mgr is null;

     ENAME
    ----------
     KING



No comments:

Post a Comment