Is there a way to resolve this without aliases? I would like to use some
objects that would handle the resultset of a particular table, and if some
queries refer to cola as colx, there would be no way to re-use the code.
For example
select * from test1, test2
//call method to get test1
test1ResultsetHandler(resultset)
//call method to get test1
test2ResultsetHandler(resultset)
----------
From: Ken J. Wright[SMTP:ken@ori-ind.com]
Sent: Wednesday, February 09, 2000 6:17 PM
To: Phillip Rhodes; 'pgsql-interfaces@postgreSQL.org'
Subject: Re: [INTERFACES] jdbc question
At 15:50 02/09/2000 -0000, Phillip Rhodes wrote:
>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
select a.*, b.col1 as col3, b.col2 as col4 from test1 a, test2 b
where a.col1 = b.col1
>The call
>rs.getInt("col1") returns successfully with a value, but there are 2 col1
>columns in the resultset.
>
>Thanks,
>Phillip
>
>
>************
>