Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL SubQueries!
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00515297
Message ID:
00515309
Views:
16
I am afraid you will need to break it down. VFP Help says:

=================
SQL: Too many subqueries (Error 1805)

The number of subqueries allowed in Visual FoxPro is two per SELECT statement. For more information, see SELECT - SQL.
=================


>I am have a problem with the following sql statement. I get an sql error as follows: Too many subqueries. Is there a limitation in VFP6 on the amount of subqueries in a select statement and what is it? Is there a work around for this problem beyond braking the select up? Thanks for your help!
>
>SELECT names.* ;
> FROM money32!names ;
> WHERE (names.id IN ;
> (SELECT names.id ;
> FROM money32!names ;
> JOIN money32!contrib ON names.id = contrib.id ;
> JOIN money32!bluebook ON contrib.source_key = bluebook.key ;
> JOIN money32!fund ON bluebook.fund_key = fund.key ;
> JOIN money32!letter ON bluebook.letter_key = letter.key ;
> JOIN money32!summary ON names.id = summary.id ;
> JOIN money32!memdata ON summary.mem_key = memdata.key ;
> JOIN money32!nameinfo ON names.id = nameinfo.id ;
> JOIN money32!pledge ON names.id = pledge.id ;
> WHERE pledge.pledgebal > 1 ;
> AND summary.hpcamt > 5 ;
> AND UPPER(letter.letter) LIKE "E%" ;
> AND UPPER(bluebook.source) LIKE "A%" ;
> AND UPPER(fund.fund) LIKE "D%" ;
> AND summary.ytdamt > 5 ;
> AND UPPER(memdata.memdesc) LIKE "C%" ;
> AND UPPER(nameinfo.email) <> SPACE(LEN(UPPER(nameinfo.email))) ) ) ;
> AND (names.deleteflag # 1) ;
> AND PADR(names.id,LEN(MainQuery.id)," ") NOT IN (SELECT id FROM MainQuery) ;
> GROUP BY names.id ;
> INTO CURSOR SQL_Query
Hector Correa
Previous
Reply
Map
View

Click here to load this message in the networking platform