Re: RE: [SQL] Why *no* ambig.uous complain in select part?

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: "Edward W(dot) Rouse" <erouse(at)comsquared(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: RE: [SQL] Why *no* ambig.uous complain in select part?
Date: 2008-08-22 20:48:42
Message-ID: 48AF262A.7030506@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi Edward,

> Just a guess, but it seems to me that since the join is using col1 and col2
> there is no ambiguity. They should be the same no matter which table it
> comes from.

Not always the same; "Left join" may return:

table2.col1,col2 = null,
while table1.col1,col2 is not null

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]
> On Behalf Of Emi Lu
> Sent: Friday, August 22, 2008 4:12 PM
> To: pgsql-sql(at)postgresql(dot)org
> Subject: [SQL] Why *no* ambig.uous complain in select part?
>
> Good morning,
>
> Just notice one small thing, and need your information about select
>
> select col1, col2
> from table1
> left join table2
> using (col1, col2)
>
> ;
>
> This query never complain about ambiguous columns of col1 and col2 in
> the select part.
>
> My guess is:
> (1) col1, col2 always return table1.col1, table1.col2
> (2) because using (col1, col2)
> that's why, table name is not necessary in select part
>
> Am I wrong? Please advise?
>
> Thank you!
>
>
>
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Emi Lu 2008-08-22 21:10:33 Re: RE: [SQL] Why *no* ambig.uous complain in select part?
Previous Message Edward W. Rouse 2008-08-22 20:44:14 RE: [SQL] Why *no* ambig.uous complain in select part?