Friday, October 24, 2014

How to count same record in a table

Hello,


Group the data by Name and filter in the having clause



SELECT Name, COUNT(*) AS Cnt
FROM yourTable
GROUP BY Name
HAVING COUNT(*) > 1





Olaf Helper


[ Blog] [ Xing] [ MVP]

No comments:

Post a Comment