tive types and array or map type columns.
>>>>>>> I do see your point about the Postgres semantics of ORDER BY vs
>>> DISTINCT
>>>>>>> ON.
>>>>>>> I don't like the hidden semantics of MySQL either.
>>>>>
t;>> I do see your point about the Postgres semantics of ORDER BY vs
> > > DISTINCT
> > > >>>> ON.
> > > >>>> I don't like the hidden semantics of MySQL either.
> > > >>>> Perhaps the compromise solution is to introduce functi
t; > >>>> Perhaps the compromise solution is to introduce functions such as
> > >>>> FIRST_ROW() aggregation function (similar to lead/lag window
> > functions)
> > >>> and
> > >>>> use GROUP BY.
> > >&
PM, Julian Hyde <jh...@apache.org>
> wrote:
> >>>>
> >>>>> I can see that it would be useful. But there are a couple of things
> >>> about
> >>>>> it that are messy.
> >>>>>
> >>>>> I think the
messy.
>>>>>
>>>>> I think the syntax is a bit clunky because it uses parentheses; a query
>>>>> would be difficult to read if people would like multiple columns,
>>>>> expressions, and aliases.
>>>>>
>>>>> I also think
ple would like multiple columns,
>> >> expressions, and aliases.
>> >>
>> >> I also think the semantics are messy. If you read
>> >> https://www.postgresql.org/docs/9.5/static/sql-select.html#
>> SQL-DISTINCT <
>> >> ht
yntax is a bit clunky because it uses parentheses; a query
> >> would be difficult to read if people would like multiple columns,
> >> expressions, and aliases.
> >>
> >> I also think the semantics are messy. If you read
> >> https://www.postgresql.org/docs/9.5
//www.postgresql.org/docs/9.5/static/sql-select.html#SQL-DISTINCT>
>> you will see that “DISTINCT ON” is evaluated after the ORDER BY clause,
>> whereas regular DISTINCT is evaluated before the ORDER BY clause. So there
>> will be a bizarre interaction if DISTINCT ON is used w
atic/sql-select.html#SQL-DISTINCT <
> https://www.postgresql.org/docs/9.5/static/sql-select.html#SQL-DISTINCT>
> you will see that “DISTINCT ON” is evaluated after the ORDER BY clause,
> whereas regular DISTINCT is evaluated before the ORDER BY clause. So there
> will be a bizarre inte
. If you read
https://www.postgresql.org/docs/9.5/static/sql-select.html#SQL-DISTINCT
<https://www.postgresql.org/docs/9.5/static/sql-select.html#SQL-DISTINCT> you
will see that “DISTINCT ON” is evaluated after the ORDER BY clause, whereas
regular DISTINCT is evaluated before the ORDER BY
The DISTINCT 'ON' clause is not supported but I am trying to see if there
are other people who have run into this. One of the use cases I have
intuitively maps to something like this:
SELECT DISTINCT *ON (a)*, b, c FROM T
Here suppose 'a' is an INT and b, c are some complex types
11 matches
Mail list logo