mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-15 09:42:58 +00:00
26 lines
713 B
SQL
26 lines
713 B
SQL
CREATE TABLE integers(i BIGINT TIME INDEX);
|
|
|
|
INSERT INTO integers VALUES (1), (2), (3);
|
|
|
|
SELECT DISTINCT i%2 FROM integers ORDER BY 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;
|
|
|
|
SELECT DISTINCT ON (1) i % 2, i FROM integers WHERE i<3 ORDER BY i;
|
|
|
|
SELECT DISTINCT integers.i FROM integers ORDER BY i DESC;
|
|
|
|
SELECT DISTINCT i FROM integers ORDER BY integers.i DESC;
|
|
|
|
SELECT DISTINCT integers.i FROM integers ORDER BY integers.i DESC;
|
|
|
|
DROP TABLE integers;
|