计算SQL Server表中某列所有值的出现次数

多谢Neeo童鞋提供

select count(1) as Count ,UserName 
from [User]
group by UserName 
order by Count desc

Comments

131 responses to “计算SQL Server表中某列所有值的出现次数”

Leave a Reply