Update T Set class = (Select Max(class) From A Where [no] = T.[no]) From A T
update a set class=case when class is null then (select top 1 class from [Table] where no=a.no and class is not null ) else class end from [Table] a
少了條件Update T Set class = (Select Max(class) From A Where [no] = T.[no]) From A T Where class Is Null
chuifengde(树上的鸟儿) ,谢谢,我怎么给你分阿
update a set class=(select top 1 class from a as t where t.no=a.no and t.class is not null) where a.class is null
create table a(no int,class int,money int)insert into a select 1,1,10 union all select 1,null,2 union all select 2,1,2 union all select 2,1,5update a set class=isnull(class,no) select * from adrop table a
select 1,1,10 union all
select 1,null,2 union all
select 2,1,2 union all
select 2,1,5update a
set class=isnull(class,no) select * from adrop table a
where class=null
where class=null