Home Forums SQL Server 2008 SQL Server 2008 - General Delete duplicate row based on one column, but need to retain rest of the values in tmp file RE: Delete duplicate row based on one column, but need to retain rest of the values in tmp file

  • Gillian_Pappas2002 (12/18/2013)


    Thank you so much. That worked really well, but for some reason, there remain a few randon duplicate co_nums rows showing up. But I truly appreciate your help. Thanks. G

    Hi,

    Pay attention on this fragment of the above posted code: OVER(PARTITION by inv_num ORDER BY name) You've decided to remove duplicates based on inv_num and here you're telling us about some co_nums.

    You can also specify more columns after PARTITION BY... as well as in after ORDER BY..

    I think you'll manage to settle up your results.

    Regards,

    IgorMi

    Igor Micev,My blog: www.igormicev.com