I am trying to delete duplicate records from a table (tempfile). I populate the file using the following sql statement:
INSERT INTO tempfile
(counter, ssn, encrypt_ssn, field1, field2,...field50)
select count(encrypt_ssn) as counter
,ssn
,encrypt_ssn
,field1
,field2
...
,field50
from permfile
group by encrypt_ssn
DELETE FROM tempfile
WHERE counter > 1 AND field1 = ""
The ... indicates there are 50 fields total (field3, field4, field5, etc). I have about 100,000 records and it is taking a long time to do. Is there a faster way of doing this? The tempfile is not indexed but the permfile has ssn and field4 as the primary key.
Thanks
Mark
INSERT INTO tempfile
(counter, ssn, encrypt_ssn, field1, field2,...field50)
select count(encrypt_ssn) as counter
,ssn
,encrypt_ssn
,field1
,field2
...
,field50
from permfile
group by encrypt_ssn
DELETE FROM tempfile
WHERE counter > 1 AND field1 = ""
The ... indicates there are 50 fields total (field3, field4, field5, etc). I have about 100,000 records and it is taking a long time to do. Is there a faster way of doing this? The tempfile is not indexed but the permfile has ssn and field4 as the primary key.
Thanks
Mark