[V4RB+Vserver] multiple JOIN

Ruslan Zasukhin sunshine at public.kherson.ua
Wed Nov 10 16:23:27 CST 2004


On 11/10/04 1:21 PM, "Eric Ferrer" <wonderfef at noos.fr> wrote:

> 
> Hello,
> 
> I have a table "Lists" with fields :
> Name, ParentUserID, ParentCompanyID
> 
> and 2 other tables "People" and "Companies", both with fields "ID" and
> "Name".
> 
> ParentUserID may contain either the ID of a person (in table People) either
> the ID of a company (in table Companies).
> 
> I need Valentina to "join" those 3 tables:
> 
> SELECT Lists.Name, Companies.Name, People.Name
> FROM Lists, Companies, People
> WHERE
> (Lists.ParentUserID *= People.ID
> OR
> Lists.ParentUserID *= Companies.ID)
> AND
> Lists.ParentCompanyID *= Companies.ID
> 
> But, of course, this does not work because the field Companies.Name cannot
> contain 2 values taken from 2 different links.

It looks you need to use ALIAS of table

SELECT Lists.Name, Companies.Name, People.Name
FROM Lists A, Companies B, People C
WHERE
    .......




> I can't figure out a workaround...
> Thanks in advance for your help.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------




More information about the Valentina mailing list