add order by in sql test

This commit is contained in:
zhanglistar 2024-12-05 11:23:24 +08:00
parent bb7d7add46
commit 4d3b3c3588
2 changed files with 30 additions and 30 deletions

View File

@ -32,42 +32,42 @@ CREATE TABLE jsons
ENGINE = Memory;
INSERT INTO jsons VALUES ('{"a":1}');
INSERT INTO jsons VALUES ('a');
SELECT simpleJSONHas(json, 'foo') FROM jsons;
SELECT simpleJSONHas(json, 'foo') as res FROM jsons order by res;
0
0
SELECT simpleJSONHas(json, 'a') FROM jsons;
SELECT simpleJSONHas(json, 'a') as res FROM jsons order by res;
0
1
SELECT simpleJSONExtractUInt(json, 'a') as res FROM jsons order by res;
0
SELECT simpleJSONExtractUInt(json, 'a') FROM jsons;
1
0
SELECT simpleJSONExtractUInt(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractUInt(json, 'not exsits') as res FROM jsons order by res;
0
0
SELECT simpleJSONExtractInt(json, 'a') FROM jsons;
SELECT simpleJSONExtractInt(json, 'a') as res FROM jsons order by res;
0
1
0
SELECT simpleJSONExtractInt(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractInt(json, 'not exsits') as res FROM jsons order by res;
0
0
SELECT simpleJSONExtractFloat(json, 'a') FROM jsons;
SELECT simpleJSONExtractFloat(json, 'a') as res FROM jsons order by res;
0
1
0
SELECT simpleJSONExtractFloat(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractFloat(json, 'not exsits') as res FROM jsons order by res;
0
0
SELECT simpleJSONExtractBool(json, 'a') FROM jsons;
SELECT simpleJSONExtractBool(json, 'a') as res FROM jsons order by res;
0
0
SELECT simpleJSONExtractBool(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractBool(json, 'not exsits') as res FROM jsons order by res;
0
0
SELECT positionUTF8(json, 'a') FROM jsons;
SELECT positionUTF8(json, 'a') as res FROM jsons order by res;
1
3
SELECT positionCaseInsensitiveUTF8(json, 'A') as res FROM jsons order by res;
1
SELECT positionCaseInsensitiveUTF8(json, 'A') FROM jsons;
3
SELECT positionCaseInsensitive(json, 'A') as res FROM jsons order by res;
1
SELECT positionCaseInsensitive(json, 'A') FROM jsons;
3
1

View File

@ -23,16 +23,16 @@ CREATE TABLE jsons
ENGINE = Memory;
INSERT INTO jsons VALUES ('{"a":1}');
INSERT INTO jsons VALUES ('a');
SELECT simpleJSONHas(json, 'foo') FROM jsons;
SELECT simpleJSONHas(json, 'a') FROM jsons;
SELECT simpleJSONExtractUInt(json, 'a') FROM jsons;
SELECT simpleJSONExtractUInt(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractInt(json, 'a') FROM jsons;
SELECT simpleJSONExtractInt(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractFloat(json, 'a') FROM jsons;
SELECT simpleJSONExtractFloat(json, 'not exsits') FROM jsons;
SELECT simpleJSONExtractBool(json, 'a') FROM jsons;
SELECT simpleJSONExtractBool(json, 'not exsits') FROM jsons;
SELECT positionUTF8(json, 'a') FROM jsons;
SELECT positionCaseInsensitiveUTF8(json, 'A') FROM jsons;
SELECT positionCaseInsensitive(json, 'A') FROM jsons;
SELECT simpleJSONHas(json, 'foo') as res FROM jsons order by res;
SELECT simpleJSONHas(json, 'a') as res FROM jsons order by res;
SELECT simpleJSONExtractUInt(json, 'a') as res FROM jsons order by res;
SELECT simpleJSONExtractUInt(json, 'not exsits') as res FROM jsons order by res;
SELECT simpleJSONExtractInt(json, 'a') as res FROM jsons order by res;
SELECT simpleJSONExtractInt(json, 'not exsits') as res FROM jsons order by res;
SELECT simpleJSONExtractFloat(json, 'a') as res FROM jsons order by res;
SELECT simpleJSONExtractFloat(json, 'not exsits') as res FROM jsons order by res;
SELECT simpleJSONExtractBool(json, 'a') as res FROM jsons order by res;
SELECT simpleJSONExtractBool(json, 'not exsits') as res FROM jsons order by res;
SELECT positionUTF8(json, 'a') as res FROM jsons order by res;
SELECT positionCaseInsensitiveUTF8(json, 'A') as res FROM jsons order by res;
SELECT positionCaseInsensitive(json, 'A') as res FROM jsons order by res;