DUAL table
The DUAL table is a special one-row, one-column table present by default in Oracle and other database installations.[src] In Oracle, the table has a single VARCHAR2(1) column called DUMMY that has a value of 'X'.[src] It is suitable for use in selecting a pseudo column such as SYSDATE or USER.[src]
The DUAL table is a special one-row, one-column table present by default in Oracle and other database installations.[src] In Oracle, the table has a single VARCHAR2(1) column called DUMMY that has a value of 'X'.[src] It is suitable for use in selecting a pseudo column such as SYSDATE or USER.[src] ==Example use== Oracle's SQL syntax requires the FROM clause but some queries don't require any tables - DUAL can be used in these cases.[src] SELECT 1+1 FROM dual; SELECT 1 FROM dual; SELECT USER FROM dual; SELECT SYSDATE FROM dual; SELECT * FROM dual; ==Optimization== Beginning with 10g Release 1, Oracle no longer performs physical or logical I/O on the DUAL table, though the table still exists.[src] DUAL is readily available for all authorized users in a SQL database.[src] ==In other database systems== Several other databases (including Microsoft SQL Server, MySQL, PostgreSQL, SQLite, and Teradata) enable one to omit the FROM clause entirely if no table is needed.[src] This avoids the need for any dummy table.[src] ClickHouse has a one-row system table system.one with a single column named "dummy" of type UInt8 and value 0.[src] This table is implicitly used when no table is specified in the SELECT query.[src] Firebird has a one-row system table RDB$DATABASE that is used in the same way as Oracle's DUAL, although it also has a meaning of its own.[src] IBM Db2 has a view that resolves DUAL when using Oracle Compatibility.[src] It also has a table called sysibm.sysdummy1 that has similar properties to the Oracle DUAL one.[src] Informix: Informix version 11.50 and later has a table named with the same functionality but a more verbose name.[src] You can use to create a name in the current database with the same functionality.[src] Microsoft Access: A table named DUAL may be created and the single-row constraint enforced via ADO (Table-less UNION query in MS Access) Microsoft SQL Server: SQL Server does not require a dummy table.[src] Queries like 'select 1 + 1' can be run without a "from" clause/table name.[src] MySQL allows DUAL to be specified as a table in queries that do not need data from any tables.[src] It is suitable for use in selecting a result function such as SYSDATE() or USER(), although it is not essential.[src] PostgreSQL: A DUAL-view can be added to ease porting from Oracle.[src] Snowflake: DUAL is supported, but not explicitly documented.[src] It appears in sample SQL for other operations in the documentation.[src] SQLite: A VIEW named "dual" that works the same as the Oracle "dual" table can be created as follows: SAP HANA has a table called DUMMY that works the same as the Oracle "dual" table.[src] Teradata database does not require a dummy table.[src] Queries like 'select 1 + 1' can be run without a "from" clause/table name.[src] Vertica has support for a DUAL table in their official documentation.[src]
29 sentences · 29 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"DUAL table." encyclopegia.org, 2023, https://encyclopegia.org/wiki/dual-table. Accessed 03 December 2026.
Chicago
"DUAL table." encyclopegia.org. Accessed December 3, 2026. https://encyclopegia.org/wiki/dual-table.
APA
encyclopegia.org. (2023). DUAL table. Retrieved December 3, 2026, from https://encyclopegia.org/wiki/dual-table
Accessed December 3, 2026 · CC BY-SA 4.0 · citation page · JSON