我想统计counted和group by table结果的结果
就像我有一张桌子,a
:
id |name
1 |abc
2 |abc
3 |abc
4 |xyz
5 |xyz
我的查询是SELECT COUNT(id) as count_id from a GROUP BY name
...给出结果:
count_id
3
2
我想计算这个结果的总行数,即 2
所以我的查询是SELECT COUNT(SELECT COUNT(id) as count_id from a GROUP BY name) as maincount from a
...但它给了我这个错误phpmyadmin
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT count.....