mysql比较恶心的一个delete in操作

mysql中
delete from sns_hits where id not in (1,2,3)
是没有问题的
delete from sns_hits where id not in (select id from another_table)
也是麽有问题的

但是
delete from sns_hits where id not in (select id from sns_hits) 
就TMD有问题了

解决棒法是创建临时表
CREATE TEMPORARY TABLE tmp_sns_hits (
  `id` BIGINT(20) 
)


太丫恶心了

你可能感兴趣的:(java,sql,mysql,SNS)