Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL subquery limits
Message
 
 
To
26/09/2001 19:09:36
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00561265
Message ID:
00561317
Views:
23
This message has been marked as the solution to the initial question of the thread.
>I am getting error 1805 Too Many Subqueries when executing an SQL query.
>The help file says there is a limit of 2 subqueries.
>
>the select statement that failed has 6 sub-select statements, if I remove one it works fine. I also found if I keep the 6 sub-queries and remove a join condition from the where clause it also works fine.
>
>Basically if i have almost any combination of JOIN conditions and subqueries up to a total of 10 ( between them) it is OK, but as soon as I try for 11 it gives error 1805.
>
>I have found several ways around the problem , but was just wondering if someone could shed some light on this.

Let's see what we know about limits on SQL Select:

- The maximum number of joins per Select statement is nine (VFP help).
- There's a limit of nine UNIONs in a single query. (Hacker's Guide to VFP 6)
- You can have up to two subqueries at the same level (not nested) in the WHERE clause. (VFP help)

The last one is incorrect. A test in VFP 6 and VFP 7 shows that the number of subqueries is limited to nine also.

It seems to me that there's a limit of 10 tables per Sql Select regardless if they're used in JOIN's, UNION's or subqueries.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform