Using Aliases in Select

Поиск
Список
Период
Сортировка
От Christian Rudow
Тема Using Aliases in Select
Дата
Msg-id 37A59B9C.79D5C4FB@thinx.ch
обсуждение исходный текст
Ответы Re: [SQL] Using Aliases in Select  (Andy Lewis <alewis@themecca.net>)
Re: [SQL] Using Aliases in Select  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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.Rudow@thinx.ch
ThinX networked business services    Stahlrain 10, CH-5200 Brugg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


В списке pgsql-sql по дате отправления:

Предыдущее
От: Thomas Good
Дата:
Сообщение: Re: [SQL] date_arithmetic revisited
Следующее
От: Andy Lewis
Дата:
Сообщение: Re: [SQL] Using Aliases in Select