Re: not unique table/alias
At 14:40 -0400 on 06/07/2004, Jack Tanner wrote about not unique table/alias: I have two complex subqueries that I need to join. I suspect this problem is due to using aliases instead of table names, but I don't know how to work around it (temporary tables?). Please help. SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2 JOIN t1 ON t2.col = t1.col; Not unique table/alias: 't1'. SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2 WHERE t2.col = t1.col; Works fine! (But this query is different, because it doesn't get the rows that are NULL in one of the tables.) Using MySQL 4.1.2. Thanks in advance for your help. I think it is screaming about a syntax error since you do not have two tables for the Join. Try: SELECT col FROM (subquery-1) AS t1 JOIN (subquery-2) AS t2 ON t2.col = t1.col; -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
not unique table/alias
I have two complex subqueries that I need to join. I suspect this problem is due to using aliases instead of table names, but I don't know how to work around it (temporary tables?). Please help. SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2 JOIN t1 ON t2.col = t1.col; Not unique table/alias: 't1'. SELECT col FROM (subquery-1) AS t1, (subquery-2) AS t2 WHERE t2.col = t1.col; Works fine! (But this query is different, because it doesn't get the rows that are NULL in one of the tables.) Using MySQL 4.1.2. Thanks in advance for your help. _ FREE pop-up blocking with the new MSN Toolbar get it now! http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
message from server: Not unique table/alias: 'USER_ROLE' ?
What does the error mean ? - message from server: Not unique table/alias: 'USER_ROLE' This happens when I try to use the java code: PreparedStatement pstmt = con.prepareStatement(Select * From USER_ROLE, ROLE + WHERE USER_ROLE.USERID = ? And USER_ROLE.ROLEID = ROLE.ID); pstmt.setInt(1, id); ResultSet rs = pstmt.executeQuery(); If i execute the same query at mysql prompt, it works perfectly fine as is. Is their a problem with the JDBC driver ? Thanks. The error thrown is: java.sql.SQLException: Invalid argument value, message from server: Not unique table/alias: 'USER_ROLE' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1613) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:880) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:939) at com.mysql.jdbc.Connection.execSQL(Connection.java:1780) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:143 9) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: message from server: Not unique table/alias: 'USER_ROLE' ?
At 12:50 +0530 3/11/03, Mufaddal Khumri wrote: What does the error mean ? - message from server: Not unique table/alias: 'USER_ROLE' This happens when I try to use the java code: PreparedStatement pstmt = con.prepareStatement(Select * From USER_ROLE, ROLE + WHERE USER_ROLE.USERID = ? And USER_ROLE.ROLEID = ROLE.ID); pstmt.setInt(1, id); ResultSet rs = pstmt.executeQuery(); If i execute the same query at mysql prompt, it works perfectly fine as is. Is their a problem with the JDBC driver ? When you execute the query at the mysql prompt, you're probably providing the required space between ROLE and WHERE. The query shown above appears to have no such space, which somewhat changes the semantics of the query. Thanks. The error thrown is: java.sql.SQLException: Invalid argument value, message from server: Not unique table/alias: 'USER_ROLE' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1613) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:880) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:939) at com.mysql.jdbc.Connection.execSQL(Connection.java:1780) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1439) - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: message from server: Not unique table/alias: 'USER_ROLE' ?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Paul DuBois wrote: At 12:50 +0530 3/11/03, Mufaddal Khumri wrote: What does the error mean ? - message from server: Not unique table/alias: 'USER_ROLE' This happens when I try to use the java code: PreparedStatement pstmt = con.prepareStatement(Select * From USER_ROLE, ROLE + WHERE USER_ROLE.USERID = ? And USER_ROLE.ROLEID = ROLE.ID); pstmt.setInt(1, id); ResultSet rs = pstmt.executeQuery(); If i execute the same query at mysql prompt, it works perfectly fine as is. Is their a problem with the JDBC driver ? When you execute the query at the mysql prompt, you're probably providing the required space between ROLE and WHERE. The query shown above appears to have no such space, which somewhat changes the semantics of the query. Thanks. The error thrown is: java.sql.SQLException: Invalid argument value, message from server: Not unique table/alias: 'USER_ROLE' at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1613) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:880) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:939) at com.mysql.jdbc.Connection.execSQL(Connection.java:1780) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1439) I concur with Paul (if you're code above is not a typo), the query you are executing is: Select * From USER_ROLE, ROLEWHERE USER_ROLE.USERID = ? And USER_ROLE.ROLEID = ROLE.ID -Mark - -- MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/ For technical support contracts, visit https://order.mysql.com/?ref=mmma __ ___ ___ __ / |/ /_ __/ __/ __ \/ / Mark Matthews [EMAIL PROTECTED] / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java /_/ /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA ___/ www.mysql.com -BEGIN PGP SIGNATURE- Version: GnuPG v1.1.90 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE+bmLQtvXNTca6JD8RAg/8AJ96tufOsgzld94xsxHNSHCpaxZJrQCfQXVT 1pFZYtUmr0mFa1a0WAYOwUY= =sUJO -END PGP SIGNATURE- - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Not unique table/alias
Hi, mysql INSERT INTO f_baldai_seq (seq, nextval) SELECT seq, nextval+1 FROM f_baldai_seq LIMIT 1; ERROR 1066: Not unique table/alias: 'f_baldai_seq' Please help. Thank's. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Not unique table/alias
Hi, I think that when you use a table for one operation pe select or insert, the table is locked and you cannot execute another operation. In your statement if you use different tables for the two operations, I don't think you'll have a problem... Ciprian I. Acatrinei wrote: Hi, mysql INSERT INTO f_baldai_seq (seq, nextval) SELECT seq, nextval+1 FROM f_baldai_seq LIMIT 1; ERROR 1066: Not unique table/alias: 'f_baldai_seq' Please help. Thank's. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Not unique table/alias
At 19:22 +0200 10/22/02, Ciprian I. Acatrinei wrote: Hi, mysql INSERT INTO f_baldai_seq (seq, nextval) SELECT seq, nextval+1 FROM f_baldai_seq LIMIT 1; ERROR 1066: Not unique table/alias: 'f_baldai_seq' Please help. It's like it says in the manual: you cannot insert into the same table that you're selecting from. http://www.mysql.com/doc/en/INSERT_SELECT.html Thank's. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Not unique table/alias
What does this mean? It is referring to the following SQL statement: INSERT INTO MaterialSubwall SELECT subwallClassId, mirrorEW, rotation + 180, sizeX, sizeY, offsetS, offsetW, offsetN, offsetE FROMMaterialSubwall; AFAIK, this is perfectly valid SQL syntax. Peter Spierenburg. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Not unique table/alias
Check out the 2nd bullet under 7.21.1 of the manual: http://www.mysql.com/documentation/mysql/bychapter/manual_Reference.html#INSERT_SELECT You could do this by creating a temporary table out of MaterialSubwall and using that to select rows for the insert. - TIM What does this mean? It is referring to the following SQL statement: INSERT INTO MaterialSubwall SELECT subwallClassId, mirrorEW, rotation + 180, sizeX, sizeY, offsetS, offsetW, offsetN, offsetE FROMMaterialSubwall; AFAIK, this is perfectly valid SQL syntax. Peter Spierenburg. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php