How to find multiple/duplicate rows with the same value

Just a short SQL script which will allow you to find mutiple rows with same values in a table. Since its a very straightforward query, it needs no further explanation :)

[sql]

select [column_name]
from [tablename]
group by [column_name]
having count(*) > 1
— � OR

Select * from [TableName] where [ColumnName] IN (
select [ColumnName] from (
select count([ColumnName]) as N, [ColumnName] from [TableName]
— Where Clause If needed
group by [ColumnName]
)a
where N > 1
)

[/sql]

There is a similar article which describes more techniques to follow for managing duplicate rows from a table .

http://support.microsoft.com/kb/139444

Published by

Rahmansaher

Dynamic technology strategist and thought leader with 18 years’ achievement rolling-out business solutions and overseeing program/project management and product development in progressively responsible operational leadership roles. Experienced cross-functional and collaborative leader with a demonstrated track record of success at the helm of large (40+) multinational teams. Skilled in diverse software development methodologies, adept at driving seamless integration across technology platforms, effectively managing and coordinating large-scale projects across all phases. Creative thinker who intelligently manages resources, identifies potential partners, and fosters communication to improve the bottom-line.

Leave a Reply

Your email address will not be published. Required fields are marked *