Using Aliases in Select

From: Christian Rudow <Christian(dot)Rudow(at)thinx(dot)ch>
To: PostgreSQL SQL <pgsql-sql(at)postgreSQL(dot)org>
Subject: Using Aliases in Select
Date: 1999-08-02 13:22:36
Message-ID: 37A59B9C.79D5C4FB@thinx.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I join 2 tables that both have a row "mytext".
I want to use both text fields in the select (projection) clause, giving
alias names to them.

select tab1.name, tab1.mytext text1, tab2.mytext text2
from tab1, tab2
where tab1.tab1_id = tab2.tab1_id

but ...

ERROR: Column 'mytext' is ambiguous

Is there a solution to this ?

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Christian Rudow E-Mail: Christian(dot)Rudow(at)thinx(dot)ch
ThinX networked business services Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andy Lewis 1999-08-02 13:39:45 Re: [SQL] Using Aliases in Select
Previous Message Thomas Good 1999-08-02 12:54:52 Re: [SQL] date_arithmetic revisited