记录条数

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

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

3062 0

MySQL分组后,统计记录条数的方法:1、统计记录条数,代码为【SELECT num,count(*) AS counts from test_a GROUP BY num】;2、对num去重后的数量的统计。MySQL分组后,统计记录条数的方法:分组后,统计记录条数:1SELECT num,count(*) AS counts from test_a GROUP BY num;查询结果如下:对num去重后的数量的统计:12SELECT count(t.counts) FROM ( SELECT num,c