duplicate

  • out of 56 columns i have in a table where emprole,empname are 2 columns which have many duplicates. how can i find rows where both empname,emprole are repeated

    like...

    JOHN   DBA

    JOHN   DBA 

  • select empname, emprole

    from mytable

    group by empname, emprole

    having count(*) > 1

    Regards,
    Rubes

  • Pretty much ya...

     

    What do you want to do next?

  • And, what is the Primary Key of the table?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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