Dummy Row

Overview

Dummy row can be used for things such as getting system date (sysdate) alone.

Oracle Dummy Table

Oracle's dummy table's called DUAL. Dual is a table which is created by oracle along with the data dictionary. It consists of exactly one column whose name is dummy and one record. The value of that record is X. As mentioned in theshort description of dual table, you can perform the following:

desc dual

Name Null? Type
----- -- ----
DUMMY VARCHAR2(1)

select * from dual;

D
-
X

The owner of dual is SYS but dual can be accessed by every user.
As dual contains exactly one row (unless someone fiddled with it), it is guaranteed to return exactly one row in select statements. Therefor, dual is the prefered table to select a pseudo column (such as sysdate

select sysdate from dual

Although it is possible to delete the one record, or insert additional records, you really should not do that!.

MS SQL Dummy Table

There is no need to have a dummy table. You can perform the following to yield the same result:
(Oracle) > select sysdate from dual
(MS SQL) > select getdate();

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License