Column1 Column2
1 Sharp
2 Sharp
3 Sharp
4 Eye
5 Eye
我需要输出
总名称
3 Sharp
2 Eye
我试图在mysql select query
中获取输出答案 0 :(得分:6)
除非有我遗漏的东西,否则请使用:
SELECT COUNT(*) AS numCount,
t.column2
FROM YOUR_TABLE t
GROUP BY t.column2
ORDER BY numCount DESC