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.
But when i did s.executeQuery("select * from t1 join t2 using (a) join t3 using (c)"); the query errored out With Regards Jayaram On Tue, Apr 27, 2010 at 1:20 AM, Knut Anders Hatlen <knut.hat...@sun.com> wrote: > On 04/27/10 04:39, Jayaram Subramanian wrote: >> Hi Knut, >> I was continuing to buddy test the Derby 4370 (using clause) and when >> trying to run the following hit the error attached... Dont know though >> whether its a valid test or not >> >> s.execute("create table t1(a int, b int, c int)"); >> s.execute("create table t2(a int, b int, c int)"); >> s.execute("create table t3(a int, b varchar(5), c int)"); >> >> s.execute("insert into t1 values (1,2,3),(2,3,4),(4,4,4)"); >> s.execute("insert into t2 values (1,2,3),(2,3,4),(5,5,5)"); >> s.execute("insert into t3 values " + >> "(2,'abc',8),(4,'def',10),(null,null,null)"); >> >> ResultSet rs=s.executeQuery("select * from t1 join t2 using (a) join >> t3 using (c)"); >> >> >> Error encountered >> ===================================== >> java.sql.SQLSyntaxErrorException: Column name 'C' is in more than one >> table in the FROM list. > > Hi Jayaram, > > I think this error is expected. Since both T1 and T2 contain a column > named C, the second join operator doesn't know whether it should join on > T1.C=T3.C or on T2.C=T3.C. > > Thanks, > > -- > Knut Anders >