Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Joins
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Re: Joins
Miscellaneous
Thread ID:
00352894
Message ID:
00352905
Views:
15
>Hi all:
> Is there a max joins in Foxpro one can have ?
> I have a simple sql statement with five joins and it is giving me syntax error.
>Here is the code:
>
>SELECT Ladetail.fcearncode;
> FROM m2mdata!ladetail INNER JOIN m2mdata!prempl ;
> Left outer JOIN m2mdata!jodrtg ;
> INNER JOIN m2mdata!ladetail ;
> INNER JOIN m2mdata!jomast ;
> INNER JOIN m2mdata!prempl ;
> INNER JOIN m2mdata!jodrtg ;
> INNER JOIN m2mdata!jomast ;
> INNER JOIN m2mdata!inmast ;
> ON (Inmast.fpartno) + (Inmast.frev) == (Jomast.fpartrev) + (Jomast.fpartno);
> ON Inwork.fcpro_id = Jodrtg.fpro_id ;
> ON Prdept.fdeptno = Prempl.fdept ;
> ON Jomast.fjobno = Jodrtg.fjobno ;
> ON Upper(ladetail.fjobno) + str(ladetail.foperno,4) == upper (jodrtg.fjobno) + str(jodrtg.foperno,4) ;
> ON Ladetail.fempno = Prempl.fempno ;
> INTO Cursor cAtemp
>

First of all, where is InWork in your Joins?

Second, I always use JOIN .. ON construction, not all JOINS, then all ON.

Don't know if it's required syntax.

Third, why so many parethesis in this code?
> ON (Inmast.fpartno) + (Inmast.frev) == (Jomast.fpartrev) +

ON (Inmast.fpartno + Inmast.frev) = (Jomast.fpartrev +..) is enough.

Fourth, I have a vague impression, that == is not optimizable operator (I'll check it in Help).
HTH
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform