34,588
社区成员
发帖
与我相关
我的任务
分享
--drop table t
create table t(ID int,AMOUNT int)
insert into t
select 1,1000 union all
select 2,1500 union all
select 3,500
go
select *,
case when amount <= 500 then '消费500以内'
when AMOUNT >= 1000 then '消费1000以上'
end LEVEL
from t
/*
ID AMOUNT LEVEL
1 1000 消费1000以上
2 1500 消费1000以上
3 500 消费500以内
*/