Re: Join Correlation Name

2019-11-01 Thread Vik Fearing
On 30/10/2019 09:04, Fabien COELHO wrote: > >> I think possibly what the spec says (and that neither my patch nor >> Peter's implements) is assigning the alias just to the > list>.  > > I think you are right, the alias is only on the identical columns. > > It solves the issue I raised about

Re: Join Correlation Name

2019-10-30 Thread Fabien COELHO
Bonjour Vik, Is quoting the spec good enough? SQL:2016 Part 2 Foundation Section 7.10 : Ah, this is the one information I did not have when reviewing Peter's patch. ::=     USING[ AS ] ::=     I think possibly what the spec says (and that neither my patch nor Peter's

Re: Join Correlation Name

2019-10-29 Thread Vik Fearing
On 29/10/2019 15:20, Tom Lane wrote: > Vik Fearing writes: >> On 29/10/2019 12:24, Isaac Morland wrote: >>> If you need to refer specifically to the non-qualified version in a >>> different part of the query, you can give an alias to the result of >>> the join: >>> ... (a join b using (z)) as t

Re: Join Correlation Name

2019-10-29 Thread Tom Lane
Vik Fearing writes: > On 29/10/2019 12:24, Isaac Morland wrote: >> If you need to refer specifically to the non-qualified version in a >> different part of the query, you can give an alias to the result of >> the join: >> ... (a join b using (z)) as t ... > Yes, this is about having standard SQL

Re: Join Correlation Name

2019-10-29 Thread Vik Fearing
On 29/10/2019 12:24, Isaac Morland wrote: > If you need to refer specifically to the non-qualified version in a > different part of the query, you can give an alias to the result of > the join: > > ... (a join b using (z)) as t ... Yes, this is about having standard SQL syntax for that.

Re: Join Correlation Name

2019-10-29 Thread Vik Fearing
On 29/10/2019 12:05, Peter Eisentraut wrote: > On 2019-10-29 11:47, Vik Fearing wrote: >> When joining tables with USING, the listed columns are merged and no >> longer belong to either the left or the right side.  That means they can >> no longer be qualified which can often be an inconvenience.

Re: Join Correlation Name

2019-10-29 Thread Isaac Morland
On Tue, 29 Oct 2019 at 07:05, Peter Eisentraut < peter.eisentr...@2ndquadrant.com> wrote: > On 2019-10-29 11:47, Vik Fearing wrote: > > When joining tables with USING, the listed columns are merged and no > > longer belong to either the left or the right side. That means they can > > no longer

Re: Join Correlation Name

2019-10-29 Thread Peter Eisentraut
On 2019-10-29 11:47, Vik Fearing wrote: When joining tables with USING, the listed columns are merged and no longer belong to either the left or the right side.  That means they can no longer be qualified which can often be an inconvenience. SELECT a.x, b.y, z FROM a INNER JOIN b USING (z);

Join Correlation Name

2019-10-29 Thread Vik Fearing
When joining tables with USING, the listed columns are merged and no longer belong to either the left or the right side.  That means they can no longer be qualified which can often be an inconvenience. SELECT a.x, b.y, z FROM a INNER JOIN b USING (z); The SQL standard provides a workaround for