What Is NULL

Q

What Is NULL? - Oracle DBA FAQ - Understanding SQL Basics

✍: FYIcenter.com

A

NULL is a special value representing "no value" in all data types. NULL can be used on in operations like other values. But most opertations has special rules when NULL is involved. The tutorial exercise below shows you some examples:

SET NULL 'NULL'; -- Make sure NULL is displayed

SELECT NULL FROM DUAL;
N
-
N
U
L
L

SELECT NULL + NULL FROM DUAL;
 NULL+NULL
----------
NULL
  
SELECT NULL + 7 FROM DUAL;
    NULL+7
----------
NULL

SELECT NULL * 7 FROM DUAL;
    NULL*7
----------
NULL


SELECT NULL || 'A' FROM DUAL;
N
-
A

SELECT NULL + SYSDATE FROM DUAL;
NULL+SYSD
---------
NULL

2007-04-23, 4504👍, 0💬