Delete duplicate rows

  • I have a table, EMP.

    EMP

    -----

    Empid EmpName City nuumber

    ------------------------------------------------

    1 rahul noida 321

    2 abhi noida 987

    3 dippy noida 123

    4 tom noida

    1 rahul 321

    Now I want to delete duplicate rows which have same empid but have less data in their columns than the other one.

  • Depending on what you consider as "less data" you could use

    ROW_NUMBER() OVER (PARTITION BY Empid ORDER BY EmpName desc, City desc, nuumber desc)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

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

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