Add test: ordinary DISTINCT with all const columns

This commit is contained in:
Igor Nikonov 2022-07-30 20:36:27 +00:00
parent 7245ddcc20
commit baa8b7c158
2 changed files with 12 additions and 0 deletions

View File

@ -1,8 +1,16 @@
-- { echoOn }
-- String field
SELECT Name FROM (SELECT DISTINCT Name FROM distinct) ORDER BY Name;
Bill
John
Mary
-- Num field
SELECT Num FROM (SELECT DISTINCT Num FROM distinct) ORDER BY Num;
1
3
4
5
7
-- all const columns
SELECT DISTINCT 1 as a, 2 as b FROM distinct;
1 2

View File

@ -14,9 +14,13 @@ INSERT INTO distinct (Num, Name) VALUES (7, 'Bill');
INSERT INTO distinct (Num, Name) VALUES (7, 'Mary');
INSERT INTO distinct (Num, Name) VALUES (7, 'John');
-- { echoOn }
-- String field
SELECT Name FROM (SELECT DISTINCT Name FROM distinct) ORDER BY Name;
-- Num field
SELECT Num FROM (SELECT DISTINCT Num FROM distinct) ORDER BY Num;
-- all const columns
SELECT DISTINCT 1 as a, 2 as b FROM distinct;
-- { echoOff }
DROP TABLE IF EXISTS distinct;