Received: from www.kpi.com.au (www.kpi.com.au [203.31.83.86]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA09065 for ; Wed, 9 Feb 2000 18:48:23 -0500 (EST) (envelope-from shevlandj@kpi.com.au) Received: from elite (ws00.kpi.com.au [203.39.132.213]) by www.kpi.com.au (8.9.3/8.9.3) with SMTP id KAA17839; Thu, 10 Feb 2000 10:46:57 +1100 (EST) (envelope-from shevlandj@kpi.com.au) Message-ID: <005001bf73f7$f81b0560$d58427cb@kpi.com.au> From: "Joe Shevland" To: "Phillip Rhodes" , References: <01BF7315.59104850.rhodespc@bellatlantic.net> Subject: Re: [INTERFACES] jdbc question Date: Thu, 10 Feb 2000 10:52:23 -0800 Organization: KPI Logistics Pty Ltd MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 You could try: --- SELECT test1.col1 AS t1c1, test2.col1 AS t2c1 FROM test1, test2 WHERE test1.col1 = test2.col1 --- The 'AS' being the important bit there as it will alias the parameters. I am not sure whether rs.getInt("test1.col1") would work and I cannot test this quickly where I am... anyone else? Cheers, Joe ----- Original Message ----- From: "Phillip Rhodes" To: Sent: Wednesday, February 09, 2000 7:50 AM Subject: [INTERFACES] jdbc question > If I submit a query joining two tables with identical column names, how can > I differentiate the different columns and get the correct values? > > table test1 > (col1 INTEGER, > col2 INTEGER) > > table test2 > (col1 INTEGER, > col2 INTEGER) > > > select * from test1, test2 > where test1.col1 = test2.col1 > > The call > rs.getInt("col1") returns successfully with a value, but there are 2 col1 > columns in the resultset. > > Thanks, > Phillip > > > ************ > >