Dual

From Oracle FAQ

Jump to: navigation, search

DUAL is a table owned by the SYS user that contains one row with value 'X'. This is handy when you want to select an expression and only want to get a single row back.

Sample usage

Get current date:

SELECT sysdate FROM dual;

Do some maths:

SELECT 7*8/9 FROM dual;

Extract the next value from a sequence:

SELECT myseq.NEXTVAL FROM dual;

History

According to legend this table originally contained two rows, from there the name DUAL.


Glossary of Terms
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z #
Personal tools