update s1 set foodId=s1.id from room s1,room s2 where s1.id=s2.id; update room set roomId=id 转载于:https://blog.51cto.com/huqianhao/955000