oracle中按照字段中的值进行分组统计 例如A张表中有字段b,字段b的值可能是1,2,3,4,现在想要按照时间统计字段b中1,2,3,4出现的次数,sql怎么写?谢谢啦~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select b,count(*)from tbwhere 时间范围group by b select 时间范围,count(decode(b,1,1)) 值1,count(decode(b,2,1)) 值2,count(decode(b,3,1)) 值3,count(decode(b,4,1)) 值4from tbgroup by 时间范围 select 时间,count(decode(b,1,1)) 值1,count(decode(b,2,1)) 值2,count(decode(b,3,1)) 值3,count(decode(b,4,1)) 值4from tbgroup by 时间 列行转换问题,紧急求助 帮忙给看一个java访问oracle的错误 proc如何能让程序不使用EXEC SQL BEGIN DECLARE SECTION;也能用? SQL语句问题 游标占用资源的问题 问个简单问题,要分的来,在线等答案 oracle和odbc的问题 请问在设计某个表的字段作为标志用时.最好用什么类型? 如何用程序获取oracle数据库所在的服务器机器的名称或IP 12505是何错???急!!!(j2ee+oracle8i) SQLPlus 控制台clear screen 无法使用 请教大家,怎么查询已有的DBLink??
from tb
where 时间范围
group by b
select 时间范围,
count(decode(b,1,1)) 值1,
count(decode(b,2,1)) 值2,
count(decode(b,3,1)) 值3,
count(decode(b,4,1)) 值4
from tb
group by 时间范围
select 时间,
count(decode(b,1,1)) 值1,
count(decode(b,2,1)) 值2,
count(decode(b,3,1)) 值3,
count(decode(b,4,1)) 值4
from tb
group by 时间