首页 > 代码库 > msql 批量更新

msql 批量更新

 

update table a set a.placeOnPer=‘李琳‘ where placeOnPer in(
select min(placeOnPer) from (
select * from table where placeOnPer=‘李琳‘
) as a group by placeOnPer
);

update table c
set c.location=‘xxx‘ where c.guid in
select max(guid) from ( select a.guid from table a,table2 b where a.infoid=b.guid and b.placeOnPer=‘李琳‘) as a group by guid )

 

msql 批量更新