词条 | DUAL table |
释义 |
The DUAL table is a special one-row, one-column table present by default in Oracle and other database installations. In Oracle, the table has a single VARCHAR2(1) column called DUMMY that has a value of 'X'. It is suitable for use in selecting a pseudo column such as SYSDATE or USER. Example useOracle's SQL syntax requires the FROM clause but some queries don't require any tables - DUAL can be readily used in these cases. HistoryCharles Weiss explains why he created DUAL:
The original DUAL table had two rows in it (hence its name), but subsequently it only had one row. OptimizationBeginning with 10g Release 1, Oracle no longer performs physical or logical I/O on the DUAL table, though the table still exists.[2] DUAL is readily available for all the users in database. In other database systemsSeveral other databases (including Microsoft SQL Server, MySQL, PostgreSQL, SQLite, and Teradata) enable one to omit the FROM clause entirely if no table is needed. This avoids the need for any dummy table.
([https://stackoverflow.com/questions/28371342/what-is-the-oracle-equivalent-of-dual-table-in-sqlserver What is the Oracle equivalent of “Dual” table in SqlServer?])
Notes1. ^{{cite news|title=More About Oracle's History |url=http://www.oracle.com/technology/oramag/oracle/02-jan/o12sendmail.html |accessdate=4 September 2013 |newspaper=Oracle Magazine |date=January–February 2002 |deadurl=yes |archiveurl=https://web.archive.org/web/20041205061859/http://www.oracle.com/technology/oramag/oracle/02-jan/o12sendmail.html |archivedate=December 5, 2004 }} 2. ^[https://docs.oracle.com/cd/E11882_01/server.112/e41084/queries009.htm#SQLRF20036 Oracle Database SQL Language Reference 11g Release 2 (11.2), Selecting from the DUAL Table] 3. ^DB2 10.1 InfoCenter :: DB2 Version 10.1 for Linux, UNIX, and Windows - DUAL table 4. ^MySQL :: MySQL 5.0 Reference Manual :: 13.2.8 SELECT Syntax 5. ^PostgreSQL :: PostgreSQL Wiki :: Oracle to Postgres Conversion 2 : Databases|Oracle software |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。