Recently in the Data Warehouse, because some of the almost fixed value of the table, need to write some data directly, read some information. It is found that many are from dual.
What is dual?
Dual is a pseudo-table in Oracle that can be used to set or view a sequence, or to call some built-in functions, at a convenient time.
Simply put, the dual table is a table created automatically by Oracle and the data dictionary, which is a single-column table with only 1 columns: DUMMY, the data type is VERCHAR2 (1), and the dual table has only one data ' X ', Oracle has internal logic to ensure that there is always only one piece of data in the dual table. Dual tables are primarily used to select system variables or to find the value of an expression.
Like what:
To find the current time of the system
SELECT Sysdate from Daul
To find the current time of the system and display it in a set format
Select To_char (sysdate, "Yyyy-mm-dd Hh24:mi:ss") from dual;
When the calculator uses
Select 1+2 from dual
What is dual in the Oracle database?