gpt4 book ai didi

mysql - 删除并出现连接错误

转载 作者:行者123 更新时间:2023-11-29 23:38:54 24 4
gpt4 key购买 nike

执行此查询后:

 DELETE from  swimming_class as tb1 JOIN  (SELECT class_id FROM `swimming_class`
left join swimming_school on swimming_school.school_id = swimming_class.school_id
where swimming_school.school_name is NULL) as temp ON temp.class_id = tb1.class_id

我收到此错误:

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 'as tb1 JOIN (SELECT class_id FROM swimming_class left join swimming_school on' at line 1

最佳答案

我认为您真正追求的是以下内容( SQL Fiddle ):

DELETE sc
FROM swimming_class sc
INNER JOIN swimming_school ss ON ss.school_id = sc.school_id
WHERE ss.school_name is NULL

关于mysql - 删除并出现连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26280096/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com