我有以下有效的代码:
select distinct count(b), a from test group by a order by count(b) DESC limit 10;
但我希望输出实际显示 a, count(b) (切换顺序)。很遗憾
select a, distinct count(b) from test group by a order by count(b) DESC limit 10;
不起作用。我知道的小问题,不得不在另一个程序中不断更改顺序只是一种痛苦。