Files
greptimedb/tests/cases/standalone/order/nulls_first.result
dennis zhuang 9428e70971 feat: integration test (#770)
* feat: add insert test cases

* fix: update results after rebase develop

* feat: supports unsigned integer types and big_insert test

* test: add insert_invalid test

* feat: supports time index constraint for bigint type

* chore: time index column at last

* test: adds more order, limit test

* fix: style

* feat: adds numbers table in standable memory catalog mode

* feat: enable fail_fast and test_filter in sqlness

* feat: add more tests

* fix: test_filter

* test: add alter tests

* feat: supports if_not_exists when create database

* test: filter_push_down and catalog test

* fix: compile error

* fix: delete output file

* chore: ignore integration test output in git

* test: update all integration test results

* fix: by code review

* chore: revert .gitignore

* feat: sort the show tables/databases results

* chore: remove issue link

* fix: compile error and code format after rebase

* test: update all integration test results
2023-01-10 18:15:50 +08:00

111 lines
1.9 KiB
Plaintext

CREATE TABLE test(i INTEGER, j INTEGER, t BIGINT TIME INDEX);
Affected Rows: 0
INSERT INTO test VALUES (1, 1, 1), (NULL, 1, 2), (1, NULL, 3);
Affected Rows: 3
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS LAST;
+---+---+---+
| i | j | t |
+---+---+---+
| | 1 | 2 |
| 1 | 1 | 1 |
| 1 | | 3 |
+---+---+---+
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
+---+---+---+
| i | j | t |
+---+---+---+
| | 1 | 2 |
| 1 | | 3 |
| 1 | 1 | 1 |
+---+---+---+
SELECT * FROM test ORDER BY i NULLS LAST, j NULLS FIRST;
+---+---+---+
| i | j | t |
+---+---+---+
| 1 | | 3 |
| 1 | 1 | 1 |
| | 1 | 2 |
+---+---+---+
SELECT i, j, row_number() OVER (PARTITION BY i ORDER BY j NULLS FIRST) FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
+---+---+--------------+
| i | j | ROW_NUMBER() |
+---+---+--------------+
| | 1 | 1 |
| 1 | | 1 |
| 1 | 1 | 2 |
+---+---+--------------+
SELECT i, j, row_number() OVER (PARTITION BY i ORDER BY j NULLS LAST) FROM test ORDER BY i NULLS FIRST, j NULLS FIRST;
+---+---+--------------+
| i | j | ROW_NUMBER() |
+---+---+--------------+
| | 1 | 1 |
| 1 | | 2 |
| 1 | 1 | 1 |
+---+---+--------------+
SELECT * FROM test ORDER BY i NULLS FIRST, j NULLS LAST LIMIT 2;
+---+---+---+
| i | j | t |
+---+---+---+
| | 1 | 2 |
| 1 | 1 | 1 |
+---+---+---+
SELECT * FROM test ORDER BY i NULLS LAST, j NULLS LAST LIMIT 2;
+---+---+---+
| i | j | t |
+---+---+---+
| 1 | 1 | 1 |
| 1 | | 3 |
+---+---+---+
SELECT * FROM test ORDER BY i;
+---+---+---+
| i | j | t |
+---+---+---+
| 1 | 1 | 1 |
| 1 | | 3 |
| | 1 | 2 |
+---+---+---+
SELECT * FROM test ORDER BY i NULLS FIRST;
+---+---+---+
| i | j | t |
+---+---+---+
| | 1 | 2 |
| 1 | 1 | 1 |
| 1 | | 3 |
+---+---+---+
SELECT * FROM test ORDER BY i NULLS LAST;
+---+---+---+
| i | j | t |
+---+---+---+
| 1 | 1 | 1 |
| 1 | | 3 |
| | 1 | 2 |
+---+---+---+
DROP TABLE test;
Affected Rows: 1