Mysql IN查询过长报错解决
mysql 5.7
程序中需要大批量使用update in,in语句当条件大于1000条时就会报错
sql处理
delete from table_name where exists(select t.id table_name t where state="xxx");
update table_name set state="xxx" where exists( select t.id table_name t where state="xxx" );
以上代码等同于
update table_name set state="xxx" where id in( select t.id table_name t where state="xxx");