Dulpicate rows
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Dulpicate rows

  1. #1
    Join Date
    Apr 2000
    Location
    Edison, NJ
    Posts
    759
    I have a few tables w/o indexes which now have duplicate rows. Does anyone have any scripts to count/delete them?? Thankx.

  2. #2
    Join Date
    May 2001
    Posts
    16

    delete duplicate records

    Please find the select, change it to delete when satisfied :

    select itcd, des from item_m x
    where itcd in (select itcd from item_m y
    where x.rowid != y.rowid
    and x.itcd = y.itcd)

    assumptions : table name item_m
    you want duplicate on itcd field

    Thanks,
    Rajesh

  3. #3
    Join Date
    Feb 2001
    Posts
    203
    select *
    from test_equip T1
    where T1.RowID >
    (select min(T2.RowID)
    from test_equip T2
    where T1.equipment_id =T2.equipment_id);

    This script will give you the duplicate value in your table. But it's giving only one value in duplicates. So if you want to delete then just replace select * with DELETE. Hope it will work for you.
    sree

Posting Permissions

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



Click Here to Expand Forum to Full Width