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:
00353017
Views:
13
Definitely un-nest your joins. It has been a long day and I can not follow all your joins but do it like this:
FROM ;
   table1 ;
      inner join table2 ;
          on table1.keyid = table2.fk_table1 ;
      inner join table3 ;
          on table2.keyid = table3.fk_table2

>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
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform