Just complementing the response of Luiz Santos, giving comparative examples with other Dbms:
In SQL Server or Mysql, when you want to select a value that is not contained in a specific table (such as a variable declared in a scope of query, or native function), we can simply use the command SELECT
, without specifying where we select these values from:
SELECT 'EXEMPLO'
On the other hand, in the Oracle databases, we cannot carry out the above command, considering the way Oracle works its SELECT
, obliging us to clarify where we seek this data, through the clause FROM
. For the same example given above in an Oracle database, the action would be represented by the following clause:
SELECT 'EXEMPLO' FROM DUAL
In my opinion it is a concept somewhat equisito (with gambiarra face) this table "imaginary", used for relatively simple operations (a selection), which leaves the code even confusing for those reading it or coming from another context that applies SQL.
At this link there is a brief history of the table, told by its creator, Chuck Weiss, if you are interested, in English.
I’m reading, the utility I still don’t understand https://docs.oracle.com/cd/B19306_01/server.102/b14200/queries009.htm, I just understood that it is created automatically and is accessible to all users, I hope the link helps someone get close to the answer ;)
– Guilherme Nascimento
it is an "imaginary" table for you to use functions, for example you want to use a sysdate(), you do not pdoe simply run it you have to call in a select
– Luiz Santos