query to check the duplicates

  • i have a table, where a column ABC holds value 123 , based on this column ABC , i want to find how many id's exists. this is to see how many duplicates exists for each ABC column how many id's exits.

  • The easiest way to see how many duplicates exist for each, is to just use GROUP BY and HAVING clauses.  What have you tried?

     

  • SELECT ABC, COUNT(ABC) FROM dbo.YourTableNameHere GROUP BY ABC;

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply