为了账号安全,请及时绑定邮箱和手机立即绑定

ERROR 1064 (42000): 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 'GROUP BY goods_name HAVING count(goods_name)>=2) AS t2 ON t1.goods_name=t2.goods' at line 1请问啥情况

mysql> DELETE t1 FROM tdb_goods AS t1 LEFT JOIN (SELECT goods_id,goods_name FROM
tdb_goods GROUP BY goods_name HAVING count(goods_name)>=2) AS t2 ON 
t1.goods_name=t2.goods_name WHERE t1.goods_id>t2.goods_id;


正在回答

1 回答

显示的错误提示说明了你在ON后边的t2.goods是错的,应该改成t2.goods_name。不过,你贴的代码,没有错哦

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
与MySQL的零距离接触
  • 参与学习       396886    人
  • 解答问题       3353    个

本课程涵盖全部MySQL数据库的基础,学习MySQL数据库的基础知识

进入课程

ERROR 1064 (42000): 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 'GROUP BY goods_name HAVING count(goods_name)>=2) AS t2 ON t1.goods_name=t2.goods' at line 1请问啥情况

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信