with a as(
select case
when grand_total<1000 THEN ‘0-1000’
when grand_total BETWEEN 1000 AND 5000 THEN ‘1000-5000’
else ‘>5000’ end as grand
from orders
)
select grand,count(*) cun from a group by grand order by cun desc
case when then else end
最新推荐文章于 2023-12-27 14:00:42 发布