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

Re: [INTERFACES] jdbc question

From: "Ken J(dot) Wright" <ken(at)ori-ind(dot)com>
To: Phillip Rhodes <rhodespc(at)bellatlantic(dot)net>, "'pgsql-interfaces(at)postgreSQL(dot)org'" <pgsql-interfaces(at)postgreSQL(dot)org>
Subject: Re: [INTERFACES] jdbc question
Date: 2000-02-09 23:17:31
Message-ID: 3.0.1.32.20000209151731.02096c70@ori-ind.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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
>
>
>************
>

In response to

Responses

pgsql-interfaces by date

Next:From: Bryan WhiteDate: 2000-02-09 23:42:16
Subject: Re: [INTERFACES] The persistance of C functions
Previous:From: Craig OrsingerDate: 2000-02-09 22:19:19
Subject: RE: [INTERFACES] The persistance of C functions

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