Thanks.
The comma was a miskey. Also I am sure that the query is not a Cartesion join.
At this point, I split it into two separate joins and it works. I did much testing to confirm the absence of other errors. I even used the Query Builder to create the exact some query which resulted in the same error.
>You may have just typed this incorrectly in the message...
>
>You do not need a comma at the end of the line:
> From tbl1,;
>Should be
> From tbl1 ;
>
>As for the error message, it may not be complaining about 'too many subqueries'
>
>Try breaking down the query into single joins to test each option...
>
>Also make sure that you do not have a cartesian join
>
>I created a test sql as an example with more joins than you are trying and it worked fine...
>
>select customer.*, rates.crate_code_key as test, t1.crate_code_key as test1, t2.crate_code_key as test3, t3.crate_code_key as test4, t4.crate_code_key as test5 ;
>from customer ;
>join rates on customer.ccust_key=rates.ccust_key ;
>join t1 on customer.ccust_key=t1.ccust_key ;
>join t2 on customer.ccust_key=t2.ccust_key ;
>join t3 on customer.ccust_key=t3.ccust_key ;
>join t4 on customer.ccust_key=t4.ccust_key ;
>where customer.ccust_key='_S730I2QXI' ;
>into cursor t5
>
>Hope this helps...
>
>
>>Received the error message 'too many subqueries'. It didn't seem right to me. (Partly because I understood a subquery to be something different.)
>>
>>I did a very simple query. All INNER JOINS on one primary table. There were approximately 11 INNER JOINS to that table. I am pretty confident about my SQL SELECT statement. Just to be sure I used the query interface (builder?) to do the same thing. It build essentially the same code and the same error occurred.
>>
>>(I was hoping to be lazy and avoid writing the darn statement but here it is in crude example form...)
>>
>>SELE tbl1.*, tbl2.xyz2, tbl3.xyz3, tbl4.xyz4, tbl5.xyz5;
>>FROM tbl1, ;
>>INNER JOIN tbl2 ON tbl1.key2 = tbl2.key2;
>>INNER JOIN tbl3 ON tbl1.key3 = tbl3.key3;
>>INNER JOIN tbl4 ON tbl1.key4 = tbl4.key4;
>>INNER JOIN tbl5 ON tbl1.key5 = tbl5.key5
>>
>>Of course I had more INNER JOINs but all were joined on the one primary table.
>>
>>Is this a limitation of VFP? Any other pointers?
>>
>>Thanks.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only