db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: gentle reminder: buddy testers needed
Date Tue, 27 Apr 2010 14:36:07 GMT
Hi Jayaram,

Thanks for testing the functionality so thoroughly! Please see my
comments inline.

On 04/27/10 14:14, Jayaram Subramanian wrote:
> Thank Knut,
> But i observed one more thing...  When i did
> ResultSet rs=s.executeQuery("select * from t1 join t2 using (a) join
> t3 using (a)"); the query went through and was able to produce
> results.

In this case, the query is nested like this:


The columns returned by the first join operator, T1 JOIN T2 USING (A),
are: A, T1.B, T1.C, T2.B, T2.C (note: the column in the USING clause is
only returned once, even though it exists both in T1 and T2)

This result is OK to join with T3 using column A, since both operands
have exactly one column named A.

> But when i did  s.executeQuery("select * from t1 join t2 using (a)
> join t3 using (c)");  the query errored out

This query is nested the same way as the query above, so the columns
returned by the first join operator are still A, T1.B, T1.C, T2.B, T2.C.
Now, since the second join operator specifies column C in the USING
clause, it fails because the right operand has two columns named C (T1.C
and T2.C), so the join operator doesn't know which one to use.

Knut Anders

View raw message