You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When selecting a distinct rows and ordering by another column I see strange result. Most of RDBMS return error on queries like this, except MySQL (behavior is documented).
document that it is implementation specific behavior;
throw an exception (and document this behavior).
I like second variant, but first is more free. Because it is sometimes usable, and also it could be correct (well specified) in subset of cases.
By the way, it is impossible to specify clear semantic (distinct after order or distinct before order) when doing ORDER BY and DISTINCT by different columns, because in query execution pipeline, there are 'partial sorting' and 'partial distinct' steps, which could be interleaved.
Activity
alexey-milovidov commentedon Jul 13, 2016
There are two possibilities:
I like second variant, but first is more free. Because it is sometimes usable, and also it could be correct (well specified) in subset of cases.
By the way, it is impossible to specify clear semantic (distinct after order or distinct before order) when doing ORDER BY and DISTINCT by different columns, because in query execution pipeline, there are 'partial sorting' and 'partial distinct' steps, which could be interleaved.
alexey-milovidov commentedon May 16, 2019
@BayoNet ???
alexey-milovidov commentedon Sep 24, 2020
There is one more argument that we should throw an exception: #15249
olgarev commentedon Apr 30, 2021
@alexey-milovidov The documentation was updated.
support const column in c2r (ClickHouse#54)
Merge remote-tracking branch 'origin/master' into windows-cross-build