Syed Akbar Ali

Simple SQL query to get duplicate values in a table

This is simple T-SQL query to find duplicate values in Microsoft SQL Server Database

select a.field1, a.field2,a.field3, a.field4
    from table a
     where 1 < (select count(*)
      from table b
        where b.field1 = a.field1
          and b.field2 = a.field2
          and b.field3 = a.field3)
Posted: Sep 11 2008, 06:54 PM by akbaralis | with 3 comment(s)
Filed under: ,

Comments

dd said:

kamine sahi to likh deta

# June 23, 2010 3:13 PM

Tushar said:

This is really helpful. Worked on Oracle as well

# May 30, 2011 1:59 AM

umesh said:

Retrive duplicate value from table in sql

# September 9, 2011 12:57 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)