What is dual in the Oracle database?

Source: Internet
Author: User

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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.