HomeOracle Page 2 - Using Scalar Functions for Retrieving Data
How to use the Dual table - Oracle
In this fifth part of a nine-part series on retrieving data from tables with the SELECT statement, you'll learn how to use scalar functions, and more. This article is excerpted from chapter three of the book Murach's Oracle SQL and PL/SQL, written by Joel Murach (Murach Publishing; ISBN: 9781890774509).
The Dual table is automatically available to all users. This table is useful for testing expressions that use literal values, arithmetic calculations, and functions as shown in figure 3-8. In particular, the Dual table is often used in the documentation that shows how Oracle’s built-in scalar functions work.
In the example in this figure, the second column in the result set shows the value of the calculation 10 minus 7, and the third column shows the date that’s returned by the SYSDATE function. This shows that you can perform test calculations in more than one column of the Dual table.
A SELECT statement that uses the Dual table
SELECT 'test' AS test_string, 10-7 AS test_calculation, SYSDATE AS test_date FROM Dual
The Dual table is automatically created and made available to users.
The Dual table is useful for testing expressions that use literal values, arithmetic, operators, and functions.
--------------------------------------------Figure 3-8 How to use the Dual table
Please check back for the next part of the series.