Dual in Oracle

By Santhosh N

What is the real purpose of dual in oracle.

In simple, DUAL is a table.
It contains ONE column and ONE record. Oracle has created this since it makes some calculations more convenient.

Examples:

1) SELECT (10/2)+10 FROM DUAL;

2) You can use it to increment sequences:

SELECT SomeSe q_seq.NEXTVAL FROM DUAL;

3) You can use it to play around or test some SQL:

SELECT CHR(30) FROM DUAL;

Dual in Oracle  (1825 Views)