Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Help
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00638949
Message ID:
00639022
Vues:
23
>Works like a charm. Now I am trying to delete the records that do not match. How would I do that.
>
>Thanks
>
>Brenda

The DELETE-SQL command is very limited in VFP. It doesn't allow to use WHERE clause to join tables. You'll have to use procedural code.
Select table1
SET ORDER TO custn1_2    && index on custn1+custn2
Select table2
SET RELATION TO custn1+custn2 INTO table1

SCAN FOR NOT FOUND("table1")
    DELETE
ENDSCAN
Or
SELECT * FROM table2 ;
  WHERE custn1+custn2 NOT IN ( SELECT custn1+custn2 FROM table1) ;
  INTO CURSOR crsNotin1 NOFILTER
INDEX ON custn1+custn2 TAG custn1_2    
SET ORDER TO custn1_2
Select table2
SET RELATION TO custn1+custn2 INTO crsNotin1

SCAN FOR NOT FOUND("crsNotin1")
    DELETE
ENDSCAN
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform