这个mySQL删除语句为什么出错啊?? 400 报错
delete from blog b,comment c wher b.bid = c.bid AND b.bid = 9
就是想删除这两个表中字段bid = 9的所有数据
delete blog,comment from blog inner join comment blog.bid = comment.bid where blog.bid = 9######
elete from blog b,comment c wher b.bid = c.bid AND b.bid = 9
少了个e
######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 'b,comment c wher b.bid = c.bid AND b.bid = 9354' at line 1
语句输入正确的
delete from blog b,comment c where b.bid = c.bid AND b.bid = 9354
###### #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 b,`comment` AS c where b.bid = c.bid AND b.bid = 9354' at line 1######何必呢……
用两条delete效率比你这个效率高多了……
######分两条语句写 放在一个事物里
delete from blog where bid =9
delete from comment where bid =9
######delete要指定删除哪个表吧? 是不是不能同时删除两个?######连接删除时要,指定删除那个表的内容:
delete b.* from blog b,comment c wher b.bid = c.bid AND b.bid = 9
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。