mysql 删除语句的问题
deletefromt_yimutian_priceawherenotexists(select1from(selectMIN(id)idfromt_yimutian_p...
delete from t_yimutian_price a where
not exists(select 1 from(select MIN(id) id from t_yimutian_price group by
name,price,low_price,high_price,avg_price,unit,DATE_FORMAT(create_time,'%Y-%m_%d'),location,province) b) where a.id=b.id
请问这句语句有什么错误?
[Err] 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 'a where
not exists(select 1 from(select MIN(id) id from t_yimutian_price group' at line 1 展开
not exists(select 1 from(select MIN(id) id from t_yimutian_price group by
name,price,low_price,high_price,avg_price,unit,DATE_FORMAT(create_time,'%Y-%m_%d'),location,province) b) where a.id=b.id
请问这句语句有什么错误?
[Err] 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 'a where
not exists(select 1 from(select MIN(id) id from t_yimutian_price group' at line 1 展开
1个回答
展开全部
第一行末尾那个where去掉?
追问
不要问我啊。。。我在问。。。
追答
你一句sql两个where,怎么能行?你把not exists(select 1 from(select MIN(id) id from t_yimutian_price group by
name,price,low_price,high_price,avg_price,unit,DATE_FORMAT(create_time,'%Y-%m_%d'),location,province) b)这个条件删除,看看你sql结构
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询