What Is NULL?
Page 1 of 1
What Is NULL?
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
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
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal