Query so slow. was; Re: [AccessD] delete duplicates

MartyConnelly martyconnelly at shaw.ca
Tue Sep 16 00:07:58 CDT 2003


How about trying something like

SELECT First(Table1.Field1) AS Field1, First(Table1.Field2) AS Field2, 
Table1.id  INTO TableNew
FROM Table1
GROUP BY Table1.id;

Then selete and rename tablenew if you want


ACC: How to Delete Duplicate Records from a Table
http://support.microsoft.com/default.aspx?scid=kb;en-us;109329
http://support.microsoft.com/default.aspx?scid=kb;en-us;209183
http://support.microsoft.com/default.aspx?scid=kb;en-us;209573
http://support.microsoft.com/default.aspx?scid=kb;en-us;292634

Pedro Janssen wrote:

>Hello Group,
>
>i use the query's below to delete he second or third etc duplicate from
>fieldA.
>It is working fine with 50 records or so. When i use it on a Table with 9000
>records
>query2 still runs after a few hours. What can be wrong?
>
>TIA
>
>Pedro Janssen
>
>
><query1/>
>SELECT First(test.PK) AS FirstOfPK, test.FieldA
>>From test
>GROUP BY test.FieldA;
>
>
><query2/>
>DELETE test.FieldA
>FROM test
>WHERE test.PK Not In (Select FirstOfPK from Query1);
>
>
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>  
>




More information about the AccessD mailing list