I have a large DBF table in ADS that may contain duplicate records. A duplicate record is identified by any record where field2, field3, field5, field4, field8 and field7 match another record. I need to identify duplicate records and delete them. To accomplish this I'm trying to write a set of records to a second table. Even though a duplicate record is identified by six fields, I need to write the entire record, 30 fields, to the second table. I have tried the following code:
insert into table2 select * from table1 where (
field2, field3, field5, field4, field8, field7
) in (
select field2, field3, field5, field4, field8, field7
from table1 where field3 not like '%FOO%' and field3 not like '%BOO%'
group by field2, field3, field5, field4, field8, field7 having count(*) > 1
)
ADS error message: ERROR IN SCRIPT: poQuery: Error 7200: AQE Error: State = 42000; NativeError = 2115; [iAnywhere Solutions][Advantage SQL Engine]Expected lexical element not found:) There was a problem parsing the WHERE clause in your SELECT statement.
Any and all help is appreciated.
As long as you already have the alternate table available with those columns, you should be good with...