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 

效果:

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM