From the course: Oracle Database 12c: Basic SQL

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

The special Oracle DUAL table

The special Oracle DUAL table

- [Instructor] The dual table in Oracle is a special table created during installation of the Oracle database, and it's especially useful when we want to retrieve constant literal strings from the database without selecting any actual database data or experiment with certain SQL functions. So for example, say that you want to return the hello world string from an Oracle database. Without specify a from clause in your SQL statement, unlike other database engines, the following query will fail in Oracle telling us that the from keyword was not found. Luckily for us, dual comes to the rescue. Simply typing from dual and running the query again will return us the desired output. We can also use dual in combination of certain SQL functions. So for example, I can type upper hello world from dual, and my query will return an uppercase value for hello world. The dual table itself contains a single row. That's why when…

Contents