Duplicate numbers in a column

  • column 1 (char), column 2 (char) column 3 (int)

    column1 (vendor_num) has duplicate numbers

    column 2 (name)

    column 3 (o_objid)

    Example:

    select vendor_num, name, o_objid

    from table

    order by vendor_num, o_objid

    vendor_num name o_objid

    100108 blah blah 1936202

    100159 blah blah again 888658

    100301 blah NULL

    100301 blah, Inc. 206395

    I need to delete the 100301 with the NULL int only. Can anyone help:hehe:

  • delete from mytable where vendor_num in (select vendor_num from mytable group by vendor_num having count (*) >1 ) and o_objid is null

    MVDBA

  • Thank you. That worked perfect!:D

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

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