SELECT <Column Name>, NumberOfTimes=COUNT(<Column Name>) FROM TableName
GROUP BY <Column Name>
ORDER BY <Column Name> DESC
we get sample result as
UsrID NumberOfTimes
------ -------------
28472 10
28467 4
27552 1
24426 12
SQL SERVER – Count Duplicate Records or Count Repeated Values (like a name comes two or more times)
Posted by PratheesLabels: Sql-Server
Subscribe to:
Posts (Atom)