Read the docs at:
http://www.mysql.com/doc/en/INSERT_SELECT.html

They said that with 4.0.14 and up, that should work!!!


Thanks
Emery
----- Original Message ----- 
From: "David Precious" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 29, 2003 10:09
Subject: Re: insert into x select * from x doesn't work


> 
> Hi
> 
> > In mysql 4.1  (and since mysql 4.0.14 or something like that) I
> > believe it's documented that an insert into X select * from X should
> > work.
> 
> IIRC, the table you're INSERTing into cannot be the same table you 
> SELECT from - you're trying to take records from the table 'foo' and 
> insert them into the same table.
> 
> > mysql> insert into foo.bar select id from foo.bar;
> > ERROR 1066: Not unique table/alias: 'bar'
> > mysql>
> 
> This error seems to support that idea - although its not a particularly 
> friendly way of saying it.  Try creating another table, and do the 
> select from that.
> 
> Hope this helps!
> 
> David P
> 
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to