62,267
社区成员
发帖
与我相关
我的任务
分享
declare @tab table
(
id int,
num int
)
insert into @tab(id,num)
select 1,1
union all
select 2,2
union all
select 3,3
select id,num=isnull((select num from @tab where id=t.id and num>1 and num<3),0) from @tab t