Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: DUAL in MySQL
<jbmorla_at_gmail.com> wrote in message
news:1147620225.124802.113610_at_v46g2000cwv.googlegroups.com...
> Hi,
>
> I just tried:
>
> create table DUAL ( X varchar ( 1 ) );
>
> in MySQL 5.
>
> Guess what: it's forbidden ;-)
[...]
Because it's there, you don't need to create it :)
+---------------+----------------+ | Variable_name | Value | +---------------+----------------+ | version | 5.0.21-max-log | +---------------+----------------+
mysql> select sysdate() from dual;
+---------------------+ | sysdate() | +---------------------+
+---------------------+
<quote>
MySQL 5.1 Reference Manual
SELECT can also be used to retrieve rows computed without reference to any
table.
For example:
mysql> SELECT 1 + 1;
-> 2
You are allowed to specify DUAL as a dummy table name in situations where no
tables are referenced:
mysql> SELECT 1 + 1 FROM DUAL;
-> 2
DUAL is purely for compatibility with some other database servers that
require a FROM clause. MySQL does not require the clause if no tables are
referenced.
</quote>
Dimitre Received on Sun May 14 2006 - 12:54:11 CDT