On Tue, May 18, 1999 at 06:44:56PM +0200, Gianmarco Armellin wrote:
> CREATE TABLE Level (
> id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
> descr VARCHAR(30) BINARY,
> parent INT REFERENCES Level(id),
> UNIQUE (descr)
> )
>
> INSERT INTO Level VALUES (
> NULL, 'Nation', NULL);
>
> INSERT INTO Level
> SELECT NULL, 'Region', ParentLevel.id FROM Level AS ParentLevel WHERE
> ParentLevel.descr='Nation';
>
> ERROR 1093 at line 12: INSERT TABLE 'Level' isn't allowed in FROM table list
Try to do the second insert into a temporary table. Then select all of
the rows from the temporary table back into Level.
Tim