select substr(to_char(update_time,'yyyy-mm-dd'),1,7) as 月份,
(case
when trunc(pm)<70 then '功率小于70'
when trunc(pm)=70 then '功率70'
when trunc(pm)=71 then '功率71'
when trunc(pm)=72 then '功率72'
when trunc(pm)=73 then '功率73'
when trunc(pm)=74 then '功率74'
when trunc(pm)=75 then '功率75'
else '功率大于76'
end
) as '功率分布情况',count(pm)
from g_test
group by substr(to_char(update_time,'yyyy-mm-dd'),1,7),'功率分布情况'
where substr(to_char(update_time,'yyyy-mm-dd'),1,7) between '201301' and '201305'
order by substr(to_char(update_time,'yyyy-mm-dd'),1,7),'功率分布情况'
;
第 12 行出现错误:
ORA-00923: 未找到要求的 FROM 关键字 |
|