这个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
分享数据库前沿,解构实战干货,推动数据库技术变革