MySQL分组后,如何统计记录条数

MySQL分组后,统计记录条数的方法:1、统计记录条数,代码为【SELECT num,count(*) AS counts from test_a GROUP BY num】;2、对num去重后的数量的统计。 MySQL分组后,统计记录条数的方法: 分组后

    <blockquote><p>MySQL分组后,统计记录条数的方法:1、统计记录条数,代码为【SELECT num,count(*) AS counts from test_a GROUP BY num】;2、对num去重后的数量的统计。</p></blockquote>

MySQL分组后,统计记录条数的方法:

分组后,统计记录条数:

739718c4f7eac57a74670ed4ef8d7e3.png

对num去重后的数量的统计:

数据库结构

3575edfb23bc4b34cf1841115fc6a1e.png

更多推荐:mysql教程(视频)

以上就是MySQL分组后,如何统计记录条数的详细内容,更多请关注每日运维其它相关文章!