[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 558
  • Last Modified:

Using Row_Number - SQL Row Iteration to fetch Duplicate record

SQL 2008

How to fetch only list of duplicate memberid rows in a member table ??

Member Table have some duplicate memberid's. This is done on purpose.

Now i need to iterate row by row and fetch all the records which has more than one member id.
0
chokka
Asked:
chokka
1 Solution
 
Ken ButtersCommented:
http://blog.sqlauthority.com/2007/07/11/sql-server-count-duplicate-records-rows/

SELECT YourColumn, COUNT(*) TotalCount
FROM YourTable
GROUP BY YourColumn
HAVING COUNT(*) > 1
ORDER BY COUNT(*) DESC
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now