select substr(t.time,0,8) as 时间,count(*) as 总数,round(avg(t.core)/1000,3) as 平均值
from tablename t
group by substr(t.time,0,8) order by substr(t.time,0,8);
该表中的列为varchar2() eg:201301051040
round 代表平均值除1000后 取小数点后3位
select substr(t.time,0,8) as 时间,count(*) as 总数,round(avg(t.core)/1000,3) as 平均值
from tablename t
group by substr(t.time,0,8) order by substr(t.time,0,8);
该表中的列为varchar2() eg:201301051040
round 代表平均值除1000后 取小数点后3位