mysql查詢某一字段出現次數前十的記錄id

SELECT DISTINCT id FROM tb WHERE id IN(
SELECT id AS NUM  FROM tb GROUP BY id ORDER BY NUM DESC

) LIMIT 0,10
相關文章
相關標籤/搜索