SQL delete in 配合使用 为什么无法删除

SQL delete in 配合使用 为什么无法删除

select * from ccc where SSQ_CHA in(select SSQ_CHA from ssqcha where SSQ_SUM>27)
能查询

select SSQ_CHA from ssqcha where SSQ_SUM>27
就 1条数据

delete from ccc where SSQ_CHA in(select SSQ_CHA from ssqcha where SSQ_SUM>27)
无法删
为什么 半天没有反应?

经测试,你的语句是可行的。

语句没错,不过如果你在执行sql的时候,如果之前有执行过update之类的语句没提交,那你之后执行sql时,都会卡住执行不了的。

你查下你的表有触发器没有。语句从表面上看应该是没有问题的。

确认一下是否有外键?
SET FOREIGN_KEY_CHECKS=0;

delete from ccc where SSQ_CHA in(select SSQ_CHA from ssqcha where SSQ_SUM>27)

SET FOREIGN_KEY_CHECKS=1;

是不是总数据量太大?
有什么错误提示没有?

回复fkzxf: 估计你没有修改safe mode. 设置一下SET SQL_SAFE_UPDATES=0;

是不是删除了,你没有发现?

mysql也是一样的.