ERROR 1066: Not unique table/alias: 'A'

Hello!

Following insert works on Oracle 7,8,9 and MS SQLServer 6,7,2000 (without
'TYPE=INNODB').
Is it posible to get MySQL to understand this insert also?

Version used:
D:\mysql\bin>mysqld-max-nt.exe -V
mysqld-max-nt.exe Ver 4.1.0-alpha-max-nt for NT on i32

---
mysql> DROP TABLE IF EXISTS A;
Query OK, 0 rows affected (0.00 sec)

mysql> CREATE TABLE A (a1 INT) TYPE=INNODB;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO A (a1) VALUES (1);
Query OK, 1 row affected (0.00 sec)

mysql> COMMIT;
Query OK, 0 rows affected (0.00 sec)

mysql> SELECT * FROM A;
+------+
| a1 |
+------+
| 1 |
+------+
1 row in set (0.00 sec)

mysql> INSERT INTO A (a1) SELECT max(a1)+1 FROM A;
ERROR 1066: Not unique table/alias: 'A'
---

Regards/
Roger Larsson




--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
roger.e.larsson [ Mi, 15 Oktober 2003 00:23 ] [ ID #76294 ]

Re: ERROR 1066: Not unique table/alias: 'A'

Hello,

Roger Larsson (RRLN) wrote:
> Hello!
<cut>

> mysqld-max-nt.exe Ver 4.1.0-alpha-max-nt for NT on i32
<cut>

> mysql> INSERT INTO A (a1) SELECT max(a1)+1 FROM A;
> ERROR 1066: Not unique table/alias: 'A'


This feature were recently implemented in 4.0.15 and merged to 4.1 tree. This
happened after 4.1.0 was released.

4.1.1 which will be released soon has it.

---
>
> Regards/
> Roger Larsson

Best regards

--
Are you MySQL certified? -> http://www.mysql.com/certification
For technical support contracts, visit https://order.mysql.com/?ref=msal
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Alexander Keremidarski <salle [at] mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer
/_/ /_/\_, /___/\___\_\___/ Sofia, Bulgaria
<___/ www.mysql.com




--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Alexander Keremidarsk[1] [ Mi, 15 Oktober 2003 12:54 ] [ ID #76296 ]

Re: ERROR 1066: Not unique table/alias: 'A'

Hi!

On Oct 15, Roger Larsson (RRLN) wrote:
> Hello!
>
> Following insert works on Oracle 7,8,9 and MS SQLServer 6,7,2000 (without
> 'TYPE=INNODB').
> Is it posible to get MySQL to understand this insert also?

Yes!
Actually, MySQL understands it now, in the 4.1 development tree.
It was implemented after 4.1.0 release.
So your query will work in 4.1.1.

> Version used:
> D:\mysql\bin>mysqld-max-nt.exe -V
> mysqld-max-nt.exe Ver 4.1.0-alpha-max-nt for NT on i32
>
> ---
> mysql> DROP TABLE IF EXISTS A;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> CREATE TABLE A (a1 INT) TYPE=INNODB;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> INSERT INTO A (a1) VALUES (1);
> Query OK, 1 row affected (0.00 sec)
>
> mysql> COMMIT;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> SELECT * FROM A;
> +------+
> | a1 |
> +------+
> | 1 |
> +------+
> 1 row in set (0.00 sec)
>
> mysql> INSERT INTO A (a1) SELECT max(a1)+1 FROM A;
> ERROR 1066: Not unique table/alias: 'A'
> ---
>
> Regards/
> Roger Larsson
>
Regards,
Sergei

--
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Sergei Golubchik <serg [at] mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
<___/ www.mysql.com

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Sergei Golubchik [ Mi, 15 Oktober 2003 13:30 ] [ ID #76297 ]

Re: ERROR 1066: Not unique table/alias: 'A'

Roger Larsson (RRLN) writes:
> Hello!
>
> Following insert works on Oracle 7,8,9 and MS SQLServer 6,7,2000 (without
> 'TYPE=INNODB').
> Is it posible to get MySQL to understand this insert also?
>
> Version used:
> D:\mysql\bin>mysqld-max-nt.exe -V
> mysqld-max-nt.exe Ver 4.1.0-alpha-max-nt for NT on i32
>
> ---
> mysql> DROP TABLE IF EXISTS A;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> CREATE TABLE A (a1 INT) TYPE=INNODB;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> INSERT INTO A (a1) VALUES (1);
> Query OK, 1 row affected (0.00 sec)
>
> mysql> COMMIT;
> Query OK, 0 rows affected (0.00 sec)
>
> mysql> SELECT * FROM A;
> +------+
> | a1 |
> +------+
> | 1 |
> +------+
> 1 row in set (0.00 sec)
>
> mysql> INSERT INTO A (a1) SELECT max(a1)+1 FROM A;
> ERROR 1066: Not unique table/alias: 'A'
> ---
>
> Regards/
> Roger Larsson
>
>
>

Already fixed in 4.1.1 to be out in few weeks.

--

Sincerely,

--
For technical support contracts, go to https://order.mysql.com/?ref=msmi
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <sinisa [at] mysql.com>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB
/_/ /_/\_, /___/\___\_\___/ Fulltime Developer and Support Coordinator
<___/ www.mysql.com Larnaca, Cyprus


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs [at] m.gmane.org
Sinisa Milivojevic [ Mi, 15 Oktober 2003 18:45 ] [ ID #76301 ]
Datenbanken » gmane.comp.db.mysql.bugs » ERROR 1066: Not unique table/alias: 'A'

Vorheriges Thema: crash-me fails on simple expresion for 4.0.15
Nächstes Thema: empty HOME variable crashes client