The answer to your IT questions
 

Advanced search  • Search tips
My QUESTIONS & ANSWERS
 Question:

What is a dual table

User ANONYMOUS
Published on: 09:09/10.03.2008
Status: OPEN
What is a dual table ?
 Answers: 1
Sort by: /\ date | rating
Image Answer by: milen
Posted on: 09:09/10.03.2008
Rating: 2.4 from possible 5 with 7 votes
DUAL is a table automatically created by Oracle and accessible to all users. It has one column, DUMMY, containing one row. It’s useful for selecting a constant or expression, because the table always exists (so the query will succeed) and the result will only be returned once (since there’s exactly one row in the table).

For example, you can use it for math:

SELECT (319/212)+10 FROM DUAL;

You can use it to increment sequences:

SELECT employee_seq.NEXTVAL FROM DUAL;

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

SELECT CHR(70) FROM DUAL;


It was named "DUAL" because the primary intention of this table was to allow users to create 2 rows for every row in a table by joining it to this system table. Nowadays it only has one row.
Vote:

Please vote! Your opinion matters!
If you haven't found what you've looking for, post a question
  
| Home | Hall of fame | Register | Log in | Terms of service | Help | Contacts |