Results 1 to 3 of 3

Thread: How to find just the dups

  1. #1
    Join Date
    Feb 2003
    Posts
    1

    Unhappy How to find just the dups

    I'm new to sql.. and I have not been able to find in the books I have the answer to this question.

    How do you code a select statement to pull out just the duplicate rows, based on just one field, which is not the primary key.

  2. #2
    Join Date
    Oct 2002
    Location
    Mexico
    Posts
    5

    Thumbs up I hope this help

    SELECT nombre_cliente,count(*)
    FROM clientes
    GROUP BY nombre_cliente
    HAVING COUNT(*)>1

  3. #3
    Join Date
    Feb 2003
    Posts
    14
    This will display rows which are having duplicates

    select distinct * from emp a
    where a.rowid < (select max(b.rowid) from emp b where b.empno = a.empno)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •