Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does "DUAL" mean? 2

Status
Not open for further replies.

LesleyW

Programmer
Mar 12, 2001
196
GB
Been looking around this forum for help with a script I am writing - it's been very helpful thank you. My script is now working!

Question - I keep coming across the term "DUAL" in some of the example code... can someone please tell me what is DUAL?

Probably a very basic question, but the only stupid question is the one that isn't asked!
 
"Dual" is a table that's defined as part of the Oracle catalog. It contains exactly one row and can be queried by anyone. Its purpose is to make available a single-row table that is needed for certain types of queries. For example

select sysdate from dual;

This query returns the current date. In order to conform to proper Oracle syntax it's necessary to select from a table. "Dual" serves the purpose here.

Please note that not all databases require a table name in select statements. The same query in SQL Server is

select getdate()

That's why SQL Server doesn't have a table like dual. It's not needed for correct syntax.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top