RE: Duplicate Records
Posted in 2000
Make a unique index for the key: (see the manual for references) here is an example I used -- step: 1 -- drop index "oasisadm".pract_efec_ben04 ; -- step: 2 -- create unique index "oasisadm".pract_efec_ben04 on "oasisadm".pract_efec_benef -- (cod_financ,titular,dep,nro_ordem,cod_pract) in imedprod03 -- DISABLED -- ; -- step: 3 -- start violations table for pract_efec_benef using pp1, pp2 max rows 500 ; -- set indexes "oasisadm".pract_efec_ben04 enabled ; -- step: 4 -- delete from pp1; -- delete before creating the index just in case -- set indexes "oasisadm".pract_efec_ben04 enabled ; -- step: 5 -- filter with pp1 and use original table to find the id's -- step 6 -- delete duplicates from original table -- delete from pract_efec_benef where rowid in (select id from losid); -- step 7 -- create unique index may have to repeat the procedure a couple of times to be sure yours > N. Daniel Bonesana > SIEMENS-ITRON BUSINESS SERVICES S.A. > Balcarce 683, (C1064AAM) Buenos Aires, Argentina. > * 54 (11) 4320-5456 * Daniel.Bonesana@siemens-itron.com.ar > > -----Original Message----- From: Libi Maniace [mailto:lmaniace@beissd.com] Sent: Monday, November 27, 2000 12:19 PM To: List Informix (E-mail) Subject: Duplicate Records Help... Is there an easy way to delete duplicate records within a table. I have a table that has item, vendor and last purchase date and cost. If we happen to buy that item from two vendors it creates two records. I am trying to consolidate the item cost into a single table by item number eliminating the vendor part. Any ideals on how to do this easily? Thanks Libi