【mysql】一维数据TopN的趋势图

创建数据表语句



数据表数据


对上述数据进行TopN排名

  1. select severity,sum(count) as sum from widgt_23 where insertTstamp>='2016-12-05 17:40:00' and insertTstamp<='2016-12-05 18:00:00' group by binary(severity) order by sum desc limit 10;


获取趋势图数据

  1. select * from widgt_23 where insertTstamp>='2016-12-05 17:40:00' and insertTstamp<='2016-12-05 18:00:00' and severity=binary('Info') ;







原文地址:https://www.cnblogs.com/ssslinppp/p/6138090.html