Sql query to retrive duplicate values

  • Hi,

    Require a sql query that will retrieve duplicate values that are present in database columns but i dodnt know which values are that..

    i have created a suppose a employee table but didnt created any column with primary key constraint on it or any unique key...

  • Require a sql query that will retrieve duplicate values that are present in database columns

    Try somethinig like this:

    SELECT EmpName, count(EmpName)

    FROM tblEmp

    GROUP BY EmpName

    HAVING count(EmpName) >= 2

  • Hi,

    suresh thanks for ur reply it do works........

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

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