>Is there a quick way to test a database for a duplicate record?
>
>Sample [mydata.dbf] check for duplicate in field [name]
>i have a rather cumbersome way of checking and would like to know if there is a more efficient code.
>
>thanks alot
>k
Yes, this is fairly easy with SELECT - SQL. For example:
select name, count(*) as count;
from mydata;
group by name;
having count > 1
GROUP BY will create a single record for each [name] in this case; count(*) counts the records in each group; HAVING will evaluate the condition after the records are grouped.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)