执行SQL:
update table1 set status2=1 where id IN( select max(id) from table1 where cid=1 group by link) ;
出现错误:
Mysql: Table name is specified twice, both as a target for UPDATE and as a separate source for data
将SQL修改为:
update table1 set status2=1 where id IN(select * from ( select max(id) from table1 where cid=1 group by link) as TEMP ) ;