Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Understanding sub-query
Message
De
16/06/2011 15:25:46
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Understanding sub-query
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01514783
Message ID:
01514783
Vues:
121
Hi,

In order to make sure that my SQL Select will work (different from the one I use here as an example) I need to understand how sub-queries work.

Here is a sample SQL Select:
select fk_fld, flda, fldb from Table1 where fk_fld IN (select pk_fld from Table2 where <somecondition> 
   group by pk_fld)
My question is, does VFP (or SQL server) when executing the above SQL Select executes the sub-query first (one time) and then executes main query checking every record of Table1 to see if value FK_FLD is in sub-query?

TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform