SQL如何查询出某一列中不同值出现的次数?

格式:

select A, count(*) as num from test2 group by A

应用:

统计超时接口出现的次数,并按出现次数降序

select   api_purpose,count(api_purpose)  as count_time_out from response_time
where run_time like "%2020-05-09%"
group by api_purpose
order by count_time_out desc 

效果:

SQL如何查询出某一列中不同值出现的次数?

 

SQL如何查询出某一列中不同值出现的次数?

上一篇:MVC路由之浅见


下一篇:按照这些优化技巧来写 SQL,连公司 DBA 也鼓掌称赞!