我试过update t A set r2=(select r2 from t B where B.r2=A.r2) where r2=3 这样说有语法错误..
这句话是错的
应该是这样:
update t set r2=(select r2 from t B,T A where B.r2=A.r2)
where r2=3
但是我不明白你的意思B.r2=A.r2??什么意思??
你HI我把
update t A set r2=(select TOP 1 r2 from t B where B.r2=A.r2) where r2=3
update t set r2 = (select distinct r2 from t where r2 <> 3) where r2 = 3
不用别名,用户表明.字段名,试试