如果B表的ID是递增排序,且等级根据ID的大小排序,则可以用以下语句更新:update a set a.grade=(select top(1) b.grade from B b where b.NO=a.NO order by ID DESC),a.name=(select top(1) b.name from B b where b.NO=a.NO order by ID DESC)from A a