怎样用一条sql语句实现下列操作 一个表有价格、种类等几列,怎样用一条sql语句实现这样的操作,查询价格在<100、100—500、500—1000、>1000的种类数量,查询结果如下显示 价格 数量<100 3 100—500 4 500—1000 9 >1000 48 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设价格为price select 价格,count(*) 数量 from( select case when price <100 then ' <100' when price>=100 and price <500 then '100-500' when price>=500 and price <1000 then '500-1000' else '>1000' end 价格, a.* from a) gtoup by 价格 测试文件 表中有BLOB字段类型,如何才能在PL/SQL DEVELOPER中更新此字段的值呀? 应用程序SQL跟踪sql_trace使用方法? 外部程序调用ORACLE存储过程的问题 oracle存储过程用数组做参数怎么写 各路高手请帮小弟看看这个过程错在那里,跪谢!!!!! 如何将sqlserver中的数据导入oracle中,急!!! 为什么在WIN2000下ORACLE的客户端安装不上? 连接查询问题 oracle启动监听配置文件出现下面该怎么解决 数据库a中的表复制到不同服务器上数据库b中,如何操作? oracle进阶问题
select 价格,count(*) 数量
from(
select
case
when price <100 then ' <100'
when price>=100 and price <500 then '100-500'
when price>=500 and price <1000 then '500-1000'
else '>1000'
end 价格,
a.*
from a)
gtoup by 价格