>Ed,
>
>I should explain why I am trying do this SELECT statement. When I try to designate Custid+Upsino as the Primary key I get "Uniqueness of Index Violated", so I am trying to determine which records are NOT unique.
>
A primary key is for a specific table, and is unique within that table. If you have a partial key that points at the parent, that's a foreign key, not a primary key, and is usually a regular index, because there can be multiple children of a given parent's primary key.
If you take the resuylts of the query I gave you the first time, you can use the result of that to pull all the 'duplicated' records from the result of the query joined with query results. If the fields were F1, F2, F3 and F4 from the query (I'm having a rought mornging, so I don't remeber what they were), you'd get the records duplicating each other by saying:
SELECT OldTable.* FROM OldTable O, Query Q;
WHERE O.f1 = Q.F1 AND O.F2 = Q.F2 AND O.F3 = Q.F3 AND O.F4 = Q.F4 ;
INTO CURSOR MyDupRecs ;
ORDER BY O.F1,O.F2, O.F3, O.F4
MyDupRecs is a cursor of records in OldTable that have 'dup' keys grouped together.
IOW, take the first query results to find the key duplicate sets, and a second query that uses the result from the first to isolated just the possible dups.