mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-19 22:40:40 +00:00
* fix: add missing error display message Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * update sqlness result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
68 lines
1.3 KiB
Plaintext
68 lines
1.3 KiB
Plaintext
CREATE TABLE integers(i bigint, ts TIMESTAMP TIME INDEX);
|
|
|
|
Affected Rows: 0
|
|
|
|
INSERT INTO integers VALUES (1, 1), (2, 2), (3, 3);
|
|
|
|
Affected Rows: 3
|
|
|
|
SELECT DISTINCT i%2 FROM integers ORDER BY 1;
|
|
|
|
+-----------------------+
|
|
| integers.i % Int64(2) |
|
|
+-----------------------+
|
|
| 0 |
|
|
| 1 |
|
|
+-----------------------+
|
|
|
|
-- TODO(LFC): Failed to run under new DataFusion
|
|
-- expected:
|
|
-- +-----------------------+
|
|
-- | integers.i % Int64(2) |
|
|
-- +-----------------------+
|
|
-- | 1 |
|
|
-- | 0 |
|
|
-- +-----------------------+
|
|
SELECT DISTINCT i % 2 FROM integers WHERE i<3 ORDER BY i;
|
|
|
|
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: For SELECT DISTINCT, ORDER BY expressions i must appear in select list
|
|
|
|
SELECT DISTINCT ON (1) i % 2, i FROM integers WHERE i<3 ORDER BY i;
|
|
|
|
Error: 3000(PlanQuery), Failed to plan SQL: This feature is not implemented: DISTINCT ON Exprs not supported
|
|
|
|
SELECT DISTINCT integers.i FROM integers ORDER BY i DESC;
|
|
|
|
+---+
|
|
| i |
|
|
+---+
|
|
| 3 |
|
|
| 2 |
|
|
| 1 |
|
|
+---+
|
|
|
|
SELECT DISTINCT i FROM integers ORDER BY integers.i DESC;
|
|
|
|
+---+
|
|
| i |
|
|
+---+
|
|
| 3 |
|
|
| 2 |
|
|
| 1 |
|
|
+---+
|
|
|
|
SELECT DISTINCT integers.i FROM integers ORDER BY integers.i DESC;
|
|
|
|
+---+
|
|
| i |
|
|
+---+
|
|
| 3 |
|
|
| 2 |
|
|
| 1 |
|
|
+---+
|
|
|
|
DROP TABLE integers;
|
|
|
|
Affected Rows: 0
|
|
|