>I create a cursor, joining two tables like this:
>
>SELECT * FROM ChildTable LEFT JOIN ParentTable;
> ON ChildTable.Key = ParentTable.Key
>
>It works fine, but I want to eliminate possible duplicate records (with the same key fields) in a ParentTable, because in that case it would be all child records duplicated in a result cursor too.
>It's not possible to organize a primary index with no duplicates in a ParentTable, I need just this cursor to be made with this logic.
>
>
>So, it could be done when I make another cursor from ParentTable:
>
>SELECT * FROM ParentTable group by ParentTable.Key:
> into cursor ParentWithoutDuplicates
>
>and join the ChildTable with the new cursor.
>
>But I don't like this way; ParentTable could have large number of records, etc.
>
>Is it a simple way to join two tables and prevent duplicates (as it was in FoxPro 2.6)?
>
>Thank's, Zlatko.
Anything that worked in FoxPro 2.6 should still work in VFP.
Apart from GROUP BY, you can also use the DISTINCT clause.
Hilmar.
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)