刪除執行此查詢後:與加盟錯誤
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
您無法從JOIN中正在使用的任何表中刪除,並且在DELETE語句中刪除表的別名 – Sal00m 2014-10-09 13:53:05
@ Sal00m那麼,你可以 - 你只需要有點聰明;-) – Strawberry 2014-10-09 13:56:40