如果table_a.id=table_b.id就在table_b在随便取一个cont更新到table_a表中cont,最终table_a id相同一组cont内容相同 SQL code: update ta set cont=(select top 1 cont from tb where id=ta.id)
SQL code: update ta set cont=(select top 1 cont from tb where id=ta.id order by cont)
需要一个排序 来确定一个值
SQL code:
update table_a set cont=(select top 1 cont from table_b where table_b.id=table_a.id order by cont)