自己再配套一下
SQL code
with aa as(
select row_number()over (order by a1)na,* from a)
,
bb as(
select row_number()over (order by b1)nb,* from b)
update bb set b1=a1 from bb,aa where na=nb
[/Quote]
with aa as(
select row_number()over (order by a1)na,* from a)
,
bb as(
select row_number()over (order by b1)nb,* from b)
update bb set b1=a1 from bb,aa where na=nb