List:General Discussion« Previous MessageNext Message »
From:Tedman Leung Date:September 29 2003 6:08am
Subject:insert into x select * from x doesn't work
View as plain text  
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. 

It's not working for me on MySQL 4.1.0 alpha, anyone else have this 
problem? is it a bug? I haven't found any other reports of this not 
working for anyone else.

Bellow is a pasted copy of what I get.

---

[1006:tedman@deltoid:~]more /proc/version
Linux version 2.4.18-26.8.0 (bhcompile@stripped) (gcc version 
3.2 20020903 (Red Hat Linux 8.0 3.2-7)) #1 Mon Feb 24 10:21:42 EST 2003
[1007:tedman@deltoid:~]mysql --version
mysql  Ver 13.5 Distrib 4.1.0-alpha, for pc-linux (i686)
[1008:tedman@deltoid:~]mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.0-alpha

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create database foo;
Query OK, 1 row affected (0.00 sec)

mysql> create table foo.bar (id int);
Query OK, 0 rows affected (0.08 sec)

mysql> insert into foo.bar select id from foo.bar;
ERROR 1066: Not unique table/alias: 'bar'
mysql>

 -- 
                       Being normal is vastly over rated : Ted Leung
Thread
insert into x select * from x doesn't workTedman Leung29 Sep
  • Re: insert into x select * from x doesn't workDavid Precious29 Sep
  • Re: insert into x select * from x doesn't workEgor Egorov29 Sep
  • Re: insert into x select * from x doesn't workDirector General: NEFACOMP29 Sep
  • Re: insert into x select * from x doesn't workDirector General: NEFACOMP29 Sep
  • Re: insert into x select * from x doesn't workMatt W30 Sep