Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining join conditions
Message
 
To
01/06/1999 16:08:23
Jorge Haro
Independent Consultant
Juarez, Mexico
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00225068
Message ID:
00225178
Views:
15
>This is what the view designer is generating
>
>
>SELECT Productos.prod_clase, Productos.prod_num, Dentradas.ent_numdoc,;
> Dentradas.ent_cantidad;
> FROM elsa!productos LEFT OUTER JOIN elsa!dentradas;
> LEFT OUTER JOIN elsa!productos ;
> ON Productos.prod_num = Dentradas.ent_numprod ;
> ON Productos.prod_clase = Dentradas.ent_clase
>
>
>The join page looks like this:
>
>LEFT OUTER JOIN Productos.prod_clase = Dentradas.ent_clase AND
>LEFT OUTER JOIN Productos.prod_num = Dentradas.ent_numprod
>
>As I said the AND doesn't seem to be doing anything to the SQL statement, and has no apparent efect on the result

Actually I never tried to JOIN the same table twice. I think it will not work this way

Did you try

SELECT Productos.prod_clase, Productos.prod_num, Dentradas.ent_numdoc,;
Dentradas.ent_cantidad;
FROM elsa!productos, elsa!dentradas ;
WHERE Productos.prod_num = Dentradas.ent_numprod ;
AND Productos.prod_clase = Dentradas.ent_clase

(as Vlad says) ?

Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Reply
Map
View

Click here to load this message in the networking platform