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

Re: [INTERFACES] jdbc question

From: Lars <lars(at)sscsinc(dot)com>
To: Phillip Rhodes <rhodespc(at)bellatlantic(dot)net>
Cc: "'pgsql-interfaces(at)postgreSQL(dot)org'" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] jdbc question
Date: 2000-02-09 21:34:38
Message-ID: Pine.BSF.4.10.10002091328130.61895-100000@maximillion.sscsinc.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
Phillip,
I believe that you can just refer to the as column number, or cast them to
another name, ie;
SELECT (test1.column1 AS columnA, test2.column1)
FROM test1, test2;

-Lars

On Wed, 9 Feb 2000, 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
> 
> 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: Craig OrsingerDate: 2000-02-09 22:19:19
Subject: RE: [INTERFACES] The persistance of C functions
Previous:From: Bryan WhiteDate: 2000-02-09 21:31:14
Subject: The persistance of C functions

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