Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the Day -- SQL Subqueries
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Tip of the Day -- SQL Subqueries
Divers
Thread ID:
00271146
Message ID:
00271146
Vues:
46
You probably already knew that the SQL "SELECT" statement will accept a subquery in the WHERE clause, as in
select * from myTable1 ;
   where myTable1.cField1 in ( select cField1 from myTable2)
It turns out that you can do this in SQL "DELETE" and "UPDATE" commands too. This is implied in the VFP Help, but not explicitly stated. For example, you can:
delete from myTable1 ;
   where myTable1.cField1 in ( select cField1 from myTable2)
and you can
update myTable1 set cField3 = "X" ;
   where myTable1.cField1 in ( select cField1 from myTable2)
File it under "U", for "Useful, Someday It Might Be".
Rick Borup, MCSD

recursion (rE-kur'-shun) n.
  see recursion.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform