DUAL is a special table automatically created by Oracle (and emulated by MySQL and MariaDB) that always contains exactly one row and one column (named DUMMY in Oracle, holding the value 'X'). Because every valid SELECT in Oracle requires a FROM clause, DUAL provides a convenient placeholder when you only need to evaluate an expression, call a scalar function, or fetch a system value. The optimizer treats DUAL efficiently, returning results without accessing disk. In MySQL and MariaDB, DUAL is optional because those systems let you omit the FROM clause, yet the keyword is still accepted for cross-compatibility. PostgreSQL, SQL Server, and SQLite have no built-in DUAL, but you can achieve the same effect by omitting FROM or by selecting from VALUES(…) or system catalogs. DUAL should never be modified or dropped, and it is owned by SYS in Oracle. Excessively joining to DUAL in large queries can add unnecessary scans, so limit its use to single-row expressions.
SELECT, FROM clause, SYSDATE, Scalar functions, VALUES clause
Oracle Database V2 (circa 1980)
Oracle requires the DUAL table for SELECT statements that lack real tables. MySQL accepts DUAL but also allows you to drop the FROM clause entirely.
PostgreSQL users can omit the FROM clause (e.g., `SELECT 1;`) or use `SELECT 1 AS col` from the implicit one-row result of VALUES, such as `SELECT 1;` or `SELECT * FROM (VALUES (1)) AS t(col);`.
Oracle's original DUAL table had the single column DUMMY with the constant 'X'. The content is irrelevant; only the single row matters.
In Oracle, DUAL is owned by SYS and should remain untouched. Dropping or altering it can break internal queries and application code.