按日期求和问题 select substr(time,1,2) time,sum(fee) form tab group by substr(time,1,2) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select substr(time,1,2) time,sum(fee) from table_name group by substr(time,1,2) select t.time,sum(t.fee) from (select substr(time,1,2) time,fee from table) t group by t.time; select substr(to_char(time,'hhmmss'),1,2) time,sum(fee) fee from tablename group by substr(to_char(time,'hhmmss'),1,2) select to_char(time,'hh') time,sum(fee) from tablename group by to_char(time,'hh')看你的time是什么类型的,是字符型的话,就用楼上兄弟们的办法 要根据你的时间存储格式加一个 group by 语句:如果是字符型的,可以按照一楼的方法。如果是时间型的,可以按照 ORARichard(没钱的日子好难过啊) 方法:group by to_char(time,'HH24') 关于 order by 子句里面用到 case when 的例子 菜鸟急求存储过程得到表中空值的方法!急求! java连接oracle数据库java.sql.SQLException: 无效的列索引问题 oracle函数编译错误。。 oracle10g的RAC可不可以抽象成一个公共IP? 高手们,很有挑战性的问题哦!VC中利用ORACLE管理数据,数据需要存储在移动硬盘中,可行不? Orcale的小问题 如何作RMAN备份 约束最复杂能到什么程度? 求助sql查询 请教有关JOB技术 oracle登陆密码被修改怎么办
from table_name
group by substr(time,1,2)
看你的time是什么类型的,是字符型的话,就用楼上兄弟们的办法
如果是字符型的,可以按照一楼的方法。
如果是时间型的,可以按照 ORARichard(没钱的日子好难过啊) 方法:
group by to_char(time,'HH24')