mysql group by分组查询后 查询个数

mysql group by分组查询后 查询个数
2个方法随便你选

<pre>
select count(distinct colA) from table1;
</pre>
<pre>
select count(*) from (select colA from table1 group by colA) gyd;
</pre>

用了子查询一定要用别名

posted @ 2019-11-14 12:45  newmiracle宇宙  阅读(3282)  评论(0编辑  收藏  举报