对错误信息进行分类汇总,并实现错误数据的自增长编号
如图:
其中num是自增长列,operation是分类标签,count是汇总数据
脚本如下:
代码如下:
select num=row_number() over(order by ht_resv.operationstatus),ht_resv.operationstatus ,
case ht_resv.operationstatus
when '3' then '成功'
when '4' then '失败'
end as 'status',count(ht_resv.id) as 'count'
from ht_resv group by ht_resv.operationstatus