mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
fix: skip replacing exprs of the DistinctOn node (#5823)
* fix: handle distinct on specially * chore: update comment
This commit is contained in:
@@ -69,6 +69,15 @@ SELECT DISTINCT CASE WHEN a > 11 THEN 11 ELSE a END FROM test;
|
||||
| 11 |
|
||||
+-------------------------------------------------------------+
|
||||
|
||||
SELECT DISTINCT ON (a) * FROM test ORDER BY a, t DESC;
|
||||
|
||||
+----+----+-------------------------+
|
||||
| a | b | t |
|
||||
+----+----+-------------------------+
|
||||
| 11 | 22 | 1970-01-01T00:00:00.004 |
|
||||
| 13 | 22 | 1970-01-01T00:00:00.002 |
|
||||
+----+----+-------------------------+
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
Affected Rows: 0
|
||||
|
||||
@@ -16,4 +16,6 @@ SELECT DISTINCT MAX(b) FROM test GROUP BY a;
|
||||
|
||||
SELECT DISTINCT CASE WHEN a > 11 THEN 11 ELSE a END FROM test;
|
||||
|
||||
SELECT DISTINCT ON (a) * FROM test ORDER BY a, t DESC;
|
||||
|
||||
DROP TABLE test;
|
||||
|
||||
Reference in New Issue
Block a user