Subject Re: [firebird-support] Insert select from and SQL standard
Author Martijn Tonies

> I've got a question concerning "insert select from". What is supposed to
> do a statement like this one : insert into a_table_name select * from
a_table_name (yes, with the same table name) according to the SQL standard ?
> I know this kind of statement has no particular interest; but I ask the
question because I don't
> have the same result using FB, Oracle, PostgreSQL and MySQL :
> - With Oracle and PostgreSQL the result is a table with twice the number
of rows and duplicated data,


> - With MySQL, the request fails with error : ERROR 1066: Not unique
table/alias: 'a_table_name',

Sounds like an SQL parser error.

> -With FB 1.5 or 2.0, if the table is empty, then the result is an empty
table, else FB loops forever.

Known error.

With regards,

Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, Oracle & MS SQL
Upscene Productions
Database development questions? Check the forum!