Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
No Duplicates
Message
 
 
À
05/05/2010 08:54:43
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
01462570
Message ID:
01463195
Vues:
25
>>Since we're using INNER JOIN, only records that joined, would be deleted. According to Hugo's blog I gave you in the very top of this thread, it may be not ANSI standard to use JOIN in Update/DELETE commands.
>>
>>Alternative way to write the same delete would be
>>
>>delete from myTable where fName in (select fName from Dups)
>>
>>---------------------------------------------------------------------------------------------------------------------------
>>BTW, last night I think I invented an interesting way to number records in one replace command, planned to even test it this morning, but forgot, of course.
>>
>>I may try it now then.
>
>
>or or or u could tell me an ill test it for you :D

Ok, my last night idea worked - not that I would recommend it:
LOCAL lnI
CREATE CURSOR crsTest (IDFld I, FName c(10))
FOR lnI = 1 TO 10
  INSERT INTO crsTest (FName) VALUES ('Ken')
  INSERT INTO crsTest (FName) VALUES ('David')
  INSERT INTO crsTest (FName) VALUES ('Michael')
  INSERT INTO crsTest (FName) VALUES ('Robert')
NEXT

INDEX on fName TAG fName

PRIVATE pnRec, pcName

pnRec = -1
pcName = crsTest.FName

replace IDFld WITH IIF(crsTest.FName == m.pcName, NVL(_VFP.SetVar('pnRec', m.pnRec+1),1), ;
NVL(_VFP.SetVar('pcName', crsTest.FName),1) * NVL(_VFP.SetVar('pnRec', 0),1)) * (m.pnRec + 1) IN crsTest NEXT 40

browse
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform