SELECT *, COUNT(DISTINCT field_name) FROM table GROUP BY id; 转载于:https://www.cnblogs.com/Zell-Dinch/articles/5072636.html