Summary: in this tutorial, you will learn about the Oracle
DUAL table which is a special table used for evaluating expressions or calling functions.
In Oracle, the
SELECT statement must have a
FROM clause. However, some queries don’t require any table for example:
SELECT UPPER('This is a string') FROM what_table;
In this case, you might think about creating a table and use it in the
FROM clause for just using the
Fortunately, Oracle provides you with the
DUAL table which is a special table that belongs to the schema of the user
SYS but it is accessible to all users.
SELECT * FROM dual;
By using the
DUAL table, you can execute queries that contain functions that do not involve any table like the
UPPER() function as follows:
SELECT UPPER('This is a string') FROM dual;
Besides calling built-in function, you can use expressions in the
SELECT clause of a query that accesses the
SELECT (10 + 5)/2 FROM dual;
DUAL table is most simple one because it was designed for fast access.
In Oracle 10g release 1 and above, Oracle treats the use of
DUAL the same as calling a function which simply evaluates the expression used in the select list. This optimization provides even better performance than directly accessing the physical