Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Eliminating duplicates with related SQL statement
Message
From
07/05/2002 05:00:00
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Eliminating duplicates with related SQL statement
Miscellaneous
Thread ID:
00653393
Message ID:
00653393
Views:
53
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.
Next
Reply
Map
View

Click here to load this message in the networking platform