Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2010
    Posts
    32

    Unanswered: How To Return Rows with Duplicate Values?

    I am fairly new to DB2, and can't figure out how to return a result set that shows me people with duplicate values in certain fields.

    For example, my table has two differnet SSN fields


    recip_ssn mbr_ssn


    11223344 234558899
    11223344 234558899


    I want to see people who have two mbr_ssns in the table that are the same value. If I try count(mbr_ssn) > 1, it may return people with different mbr_ssn numbers.


    Can anyone help?

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    i'm not sure i understand your question
    Code:
    SELECT recip_ssn 
         , mbr_ssn
      FROM daTable
    GROUP
        BY recip_ssn 
         , mbr_ssn
    HAVING COUNT(*) > 1
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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