SELECT id ,NAME,COUNT(NAME) FROM class GROUP BY NAME; 转载于:https://www.cnblogs.com/kdx-2/p/9056848.html