查询名字重复并排序
查询重复出现次数最多的前两个name
order by 的栏位必须在group by 中出现
CREATE TABLE `names` (
`name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
SELECT
NAME,
count(NAME)
FROM
NAMES
GROUP BY
NAME
ORDER BY
count(NAME) DESC
LIMIT 2