Add more tests with window expressions

This commit is contained in:
Dmitry Novik 2022-06-16 13:40:12 +00:00
parent 0663f07e67
commit 4d3ff7ee5e
2 changed files with 34 additions and 0 deletions

View File

@ -226,3 +226,29 @@ ORDER BY number ASC;
97 52 52 97 52 52
98 53 53 98 53 53
99 54 54 99 54 54
SELECT sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10))
FROM numbers(10000)
GROUP BY number % 10;
1
1
1
1
1
1
1
1
1
1
SELECT 1 + sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10))
FROM numbers(10000)
GROUP BY number % 10;
2
2
2
2
2
2
2
2
2
2

View File

@ -18,3 +18,11 @@ SELECT
avg(number) OVER (PARTITION BY number % 10) avg(number) OVER (PARTITION BY number % 10)
FROM numbers(100) FROM numbers(100)
ORDER BY number ASC; ORDER BY number ASC;
SELECT sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10))
FROM numbers(10000)
GROUP BY number % 10;
SELECT 1 + sum(number) / sum(sum(number)) OVER (PARTITION BY (number % 10))
FROM numbers(10000)
GROUP BY number % 10;