110,500
社区成员
发帖
与我相关
我的任务
分享
CREATE TABLE t
(
[status] int,
s int
)
go
insert into t ([status],s) values (1000,5000)
insert into t ([status],s) values (1001,100)
insert into t ([status],s) values (1011,200)
insert into t ([status],s) values (1003,300)
insert into t ([status],s) values (3000,400)
select 'total',s from t where [status] = 1000
UNION ALL
select 'unsure',s from t where [status] = 1001
UNION ALL
select 'sure',s as sure from t where [status] = 1011
UNION ALL
select 'timeout',s as [timeout] from t where [status] = 1003
UNION ALL
select 'reach',s as reach from t where [status] = 3000
total 5000
unsure 100
sure 200
timeout 300
reach 400