How to List Duplicate Records in a FieldLast reviewed: April 30, 1996Article ID: Q115617 |
The information in this article applies to:
This article describes how to generate a list of duplicate records in a database. The following code uses a query to generate the list of duplicates and then stores it in a cursor named LISTING:
USE c:\foxprow\tutorial\invoices
SELECT invoices.cno, COUNT(invoices.cno) FROM invoices ;
GROUP BY invoices.cno ;
HAVING COUNT(invoices.cno)>1 ;
INTO CURSOR listing
There will be two fields in the cursor LISTING, the first being customer
numbers that have duplicates, and the second being the number of duplicates
for that customer number.
|
Additional reference words: FoxMac FoxDos FoxWin 2.00 2.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |