in Advanced 

Question preview

HomeQuestion preview:
Log in

What is a dual table

image
ANONYMOUS
11:12/08.03.2008
SQL & PL/SQL
OPEN
What is a dual table ?
Do you know someone who could answer? Ask him for help
Answers: 1
Sort by: date rating
image milen
11:09/10.03.2008
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
Ask question
| Home | Hall of fame | Registration | Log in | Terms of service | Privacy policy | Help | Contacts | RSS |