select SUBSTR(tjsd,1,10),sum(clzs) from jtts.T_DTI_STAT_XZQH_CLL_LASTHOUR where 1=1
and to_char(to_date(tjsd,‘yyyymmddhh24mi’),‘dd’)=to_char(sysdate,‘dd’)
group by SUBSTR(tjsd,1,10);
查询当日数据 按小时分组 字段是varchar类型时
最新推荐文章于 2021-02-02 04:47:23 发布
select SUBSTR(tjsd,1,10),sum(clzs) from jtts.T_DTI_STAT_XZQH_CLL_LASTHOUR where 1=1
and to_char(to_date(tjsd,‘yyyymmddhh24mi’),‘dd’)=to_char(sysdate,‘dd’)
group by SUBSTR(tjsd,1,10);