Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining join conditions
Message
 
To
02/06/1999 13:01:20
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:
00225478
Views:
14
>Thanks Frank, I usually prefer to do things programmtically, so this would be the way, I feel I have more control like this.

In case of creating the view joining more tahn one table programmatically, don't forget that the SQL syntax which View Designer is showing is wrong.

>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

It has to be rearranged like:

CREATE SQL view myView AS ;
SELECT Productos.prod_clase, Productos.prod_num, Dentradas.ent_numdoc,;
Dentradas.ent_cantidad;
FROM elsa!productos ;
LEFT OUTER JOIN elsa!dentradas;
ON Productos.prod_clase = Dentradas.ent_clase ;
LEFT OUTER JOIN elsa!SomeOtherTable ;
ON Productos.prod_num = SomeOtherTable.ent_numprod ;

(assuming you put there the proper names for 2 different tables you want to join)

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
Next
Reply
Map
View

Click here to load this message in the networking platform