Questions tagged «in-subquery»

9
MySQL DELETE FROM以子查询为条件
我试图做这样的查询: DELETE FROM term_hierarchy AS th WHERE th.parent = 1015 AND th.tid IN ( SELECT DISTINCT(th1.tid) FROM term_hierarchy AS th1 INNER JOIN term_hierarchy AS th2 ON (th1.tid = th2.tid AND th2.parent != 1015) WHERE th1.parent = 1015 ); 您可能会说,如果同一提示有其他父母,我想删除1015的父母关系。但是,这产生了一个语法错误: You have an error in your SQL syntax; check the manual …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.