Christian Longberg wrote: > I have just upgraded to mysql 4 to be able to perform delete queries > with join statement. I have a simple query where I would like to delete > a number of rows in tabel t1 depending on id's found in table t2. This > doesn't seem to work and I just don't understand why!? > > mysql> delete icl from ca_x_ind_com_lvl as icl, ca_individual as ind > where icl.ind_id = ind.ind_id and ind.acc_id_id = @acc_id; > ERROR 1066: Not unique table/alias: 'icl' > > Where @acc_id is set by: set @acc_id = 2; > > What am I doing wrong? > > BR > Christian
You have a column named "icl" and have aliased a table as "icl". MySQL can't figure out which icl to use. You should use a different alias for ca_x_ind_com_lvl, or fully-specify the icl column as tablename.columnname. -Mark -- 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 --------------------------------------------------------------------- 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