Versions available for this page: CUBRID 8.3.0 | CUBRID 8.3.1 | CUBRID 8.4.0 | CUBRID 8.4.1 | CUBRID 8.4.3 | CUBRID 9.0.0 |
The IS NULL conditional expression compares to determine whether the expression specified on the left is NULL, and if it is NULL, returns TRUE and it can be used in the conditional expression. If NOT comes before the NULL keyword, the result of a NOT operation on the result of the IS NULL operation is returned.
expression IS [ NOT ] NULL
SELECT * FROM condition_tbl WHERE salary IS NULL;
=== <Result of SELECT Command in Line 1> ===
id name dept_name salary
======================================================================
7 'Brown ' 'account' NULL
--selecting rows where salary is NOT NULL
SELECT * FROM condition_tbl WHERE salary IS NOT NULL;
=== <Result of SELECT Command in Line 1> ===
id name dept_name salary
======================================================================
1 'Kim ' 'devel' 4000000
2 'Moy ' 'sales' 3000000
3 'Jones ' 'sales' 5400000
4 'Smith ' 'devel' 5500000
5 'Kim ' 'account' 3800000
6 'Smith ' 'devel' 2400000
--simple conparison operation returns NULL when operand is NULL
SELECT * FROM condition_tbl WHERE salary = NULL;
=== <Result of SELECT Command in Line 1> ===
There are no results.
0 rows selected.