×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Dina

That appears to be identical to the original statement. But one doesn't ask questions after something works, correct?

I recommend a different syntax for joining tables - use the JOIN keyword. When you use a comma-separated list and the WHERE clause, you are putting 2 different functions into one clause - I prefer reserving the WHERE clause for selectivity.

So I would rewrite your statement as here -

SELECT A.FLD12, B.FLD12
FROM LIB1.TABLE1 A JOIN LIB2.TABLE1 B
ON
A.KEYFLD1 = B.KEYFLD1 AND
A.KEYFLD2 = B.KEYFLD2

dina ramzy wrote:

Thanks a lot for you help

I might have typed something wrong in my session but the below statement works fine now :)

SELECT A.FLD12, B.FLD12 FROM LIB1.TABLE1 A, LIB2.TABLE1 B
WHERE A.KEYFLD1 = B.KEYFLD1 AND A.KEYFLD2 = B.KEYFLD2

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.