34,590
社区成员
发帖
与我相关
我的任务
分享
if object_id('tb') is not null
drop table tb
go
create table tb(A int, B int,C int)
insert into tb
select 10,NULL,NULL
union all select NULL,50,NULL
union all select NULL,90,NULL
union all select NULL,NULL,60
union all select 30,NULL,NULL
select D = (ISNULL(A,ISNULL(B,ISNULL(C,0)))) from tb
/*
D
-----------
10
50
90
60
30
(5 行受影响)
*/