Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread JOIN From different Table
Wed, Mar 24 2010 4:57 PMPermanent Link

Jianfei Xu

Hi,

the laterst version, the following query not return the correct data:

Select A.Code As A,B.Code As B, C.Code As C
FROM TESTA A
INNER JOIN TESTB B ON (A.Code=B.Code)
LEFT JOIN TESTC C ON (A.Code=C.Code) AND (B.JOB=C.JOB)

looks like join clause not allow to join with more than one table, if I mover join to where clause, it returns correct data:

Select A.Code As A,B.Code As B, C.Code As C
FROM TESTA A
INNER JOIN TESTB B ON (A.Code=B.Code)
LEFT JOIN TESTC C ON (A.Code=C.Code)
WHERE (B.JOB=C.JOB)

Jianfei
Thu, Mar 25 2010 3:01 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jianfei,

<< the laterst version, the following query not return the correct data:

Select A.Code As A,B.Code As B, C.Code As C
FROM TESTA A
INNER JOIN TESTB B ON (A.Code=B.Code)
LEFT JOIN TESTC C ON (A.Code=C.Code) AND (B.JOB=C.JOB) >>

Please send me the data that you're using.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image