Oracle Dual Table Default Value

oracle

This link clear some of the queries about dual table.

But now I am having following doubt is the execution of two queries on dual table:

Query 1

Select * from dual; 

output:

D
-
X

Query2

Select NUll from dual;

output:

D
-

Does Dual contain default value as NULL? If yes why blank is not displayed, as in case of second query.

Best Answer

It's just a display issue.

SQL> select NULL from DUAL;

N
-


SQL>

Using NVL to display NULL instead of a blank:

SQL> select NVL((select NULL from DUAL), 'NULL') from DUAL;

NVL(
----
NULL

SQL>