Skip site navigation (1) Skip section navigation (2)

Re: [INTERFACES] jdbc question

From: "Joe Shevland" <shevlandj(at)kpi(dot)com(dot)au>
To: "Phillip Rhodes" <rhodespc(at)bellatlantic(dot)net>, <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] jdbc question
Date: 2000-02-10 18:52:23
Message-ID: 005001bf73f7$f81b0560$d58427cb@kpi.com.au (view raw or flat)
Thread:
Lists: 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(at)bellatlantic(dot)net>
To: <pgsql-interfaces(at)postgreSQL(dot)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
> 
> 
> ************
> 
> 


In response to

pgsql-interfaces by date

Next:From: Jason DollerDate: 2000-02-10 19:25:17
Subject: Need Help with pgsql
Previous:From: Brian PiatkusDate: 2000-02-10 17:18:27
Subject: ODBC Declare/fetch & VB

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group