IS NULL

A field with a NULL value is a field with no value. Note: A NULL value is different from a zero value or a field that contains spaces. A field with a NULL value is one that has been left blank during record creation! IS NULL and IS NOT NULL operators is used to check null or not.

The IS NULL Operator

The IS NULL operator is used to test for empty values (NULL values).

SELECT emp_name, contact_no, address FROM Employee WHERE contact_no IS NULL;
SELECT emp_name, contact_no, address FROM Employee WHERE contact_no IS NULL OR contact_no='';
SELECT * FROM ittutorial WHERE (id IN ('value1', 'value2', 'value3') OR id IS NULL)

IS NOT NULL Operator

The IS NOT NULL operator is used to test for non-empty values (NOT NULL values).

SELECT emp_name, contact_no, address FROM Employee WHERE contact_no IS NOT NULL;
SELECT ID, NAME, ADDRESS, SALARY FROM CUSTOMERS WHERE SALARY IS NOT NULL;
SELECT ID, NAME, ADDRESS, SALARY FROM CUSTOMERS WHERE SALARY IS NOT NULL OR salary !='' ;





Previous Next


Trending Tutorials




Review & Rating

0.0 / 5

0 Review

5
(0)

4
(0)

3
(0)

2
(0)

1
(0)

Write Review Here


Ittutorial