Sql练习201908131742

orderdt_jimmy表结构:

sql查询:

select sum(case when nid >= 1 and nid <= 1000 then amount end) t1,
sum(case when nid >= 1001 and nid <= 5000 then amount end) t2,
sum(case when nid >= 5001 then amount end) t3
from orderdt_jimmy;
go

效果图:

 

posted @ 2019-08-13 17:46  ラピスラズリ(Dawn)  阅读(90)  评论(0编辑  收藏  举报