两表关联update
1 --update [表1] set 字段=value from 表1,表2
2
3 update a set a.sortnum = b.t
4 from UA_detail_ua as a ,(
5 select Row_number() over(order by model asc) as t,id,model as c
6 from UA_detail_ua
7 ) as b
8 where a.id = b.id
2
3 update a set a.sortnum = b.t
4 from UA_detail_ua as a ,(
5 select Row_number() over(order by model asc) as t,id,model as c
6 from UA_detail_ua
7 ) as b
8 where a.id = b.id