--统计根据LastName所有姓的个数
select [LastName] as 姓, count([LastName]) as 数量 from [User] group by [LastName];
实例: