Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SubQuery
Message
 
 
To
22/01/2002 03:27:52
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00607579
Message ID:
00608359
Views:
35
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform