Re: [INTERFACES] jdbc question
От | Joe Shevland |
---|---|
Тема | Re: [INTERFACES] jdbc question |
Дата | |
Msg-id | 005001bf73f7$f81b0560$d58427cb@kpi.com.au обсуждение исходный текст |
Ответ на | jdbc question (Phillip Rhodes <rhodespc@bellatlantic.net>) |
Список | pgsql-interfaces |
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" <rhodespc@bellatlantic.net> To: <pgsql-interfaces@postgreSQL.org> 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 > > > ************ > >
В списке pgsql-interfaces по дате отправления: