Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SubQuery
Message
 
 
À
22/01/2002 03:27:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Divers
Thread ID:
00607579
Message ID:
00608359
Vues:
28
>Where Nine subqueries can be used. If possible give example.

The limit of 1 only applies to nested subqueries. The following is a nested subquery (2 deep):
select * from mytable where
   field1 in (select field2 from mytable2 where
      field3 in (select field3 from mytable3 where field4 = 'Somevalue'))
The first subquery has a where clause that also has a subquery. This is not allowed in VFP.

The following is allowed:
select * from org_code where;
	org_code in (select org_code from org_code where start_org = '1.2.2.0') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.1') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.2') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.3') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.4') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.5') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.6') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.7') or;
	org_code in (select org_code from org_code where start_org = '1.2.2.8')
This is not a very well thought out query but it demonstrates the limitation.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform