phpbar.de logo

Mailinglisten-Archive

SELECT mit EXISTS geht / DELETE nicht

SELECT mit EXISTS geht / DELETE nicht

Jan Kuehl jan.kuehl at software-tomography.com
Mit Mai 26 18:26:08 CEST 2004


Hi

Hannes Korte schrieb:
> Hi,
> 
> #1064 - You have an error in your SQL syntax.  Check the manual that
> corresponds to your MySQL server version for the right syntax to use near
> 'WHERE  NOT EXISTS (  SELECT  * FROM  `abc` [...]
> 
> DELETE FROM `table1` AS t1
> WHERE NOT EXISTS (SELECT * FROM `table2` AS t2 WHERE t2.t1id = t1.id)
> AND EXISTS (SELECT * FROM `table3` AS t3 WHERE t3.t1id = t1.id);
> --> funktioniert nicht!
> 

Das Problem ist das 'AS t1'. Nimme es raus, dann funktioniert es, da 
columnName(t1.id) != columnName(t2.t1id) && columnName(t1.id) != 
columnName(t3.t1id).

tschau

-- 
Software-Tomography - we make the invisible visible!
Jan Kuehl
Software-Tomography GmbH
Karlstr.7
D-03044 Cottbus
e-Mail: jan.kuehl at software-tomography.com
http://www.software-tomography.com
Phone:  +49 (0355) 4945077
----------------------------



php::bar PHP Wiki   -   Listenarchive