Information générale
Catégorie:
Codage, syntaxe et commandes
>Using the scan still got me 6 records instead of 2 (2 records for every customer with dups-3).I need it to grab one customer from cursor dups, select all it's duplicate records into table c:\temp, process, then go on to the next customer in cursor dups. Now it's grabbing all the customers in dups, selecting all the duplicate records for those 3 customers into table c:\temp.
>
The outline for code like this should be:
SELECT to get the dups into cursor Dups
SELECT Dups
SCAN
m.CustId = Dups.CustId
SELECT * FROM Dups ;
WHERE Dups.CustId = m.CustId ;
INTO Cursor Temp
SELECT Temp && not really needed, but here for clarify
SCAN
* Process records in Temp
ENDSCAN
ENDSCAN
I suspect your second query also needs to join with the original table, but I wasn't sure exactly what you're doing.
Tamar
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement