mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
dbms: added test for usage of WITH TOTALS inside JOIN [#METR-15417].
This commit is contained in:
parent
97cbc17863
commit
e37e38991c
@ -0,0 +1,22 @@
|
||||
0 3 6
|
||||
1 12 22
|
||||
2 21 17
|
||||
3 9 0
|
||||
0 3 6
|
||||
1 12 22
|
||||
2 21 17
|
||||
3 9 0
|
||||
|
||||
0 45 0
|
||||
0 3 6
|
||||
1 12 22
|
||||
2 21 17
|
||||
3 9 0
|
||||
|
||||
0 0 45
|
||||
0 3 6
|
||||
1 12 22
|
||||
2 21 17
|
||||
3 9 0
|
||||
|
||||
0 45 45
|
@ -0,0 +1,4 @@
|
||||
SELECT k, s1, s2 FROM (SELECT intDiv(number, 3) AS k, sum(number) AS s1 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k) ANY LEFT JOIN (SELECT intDiv(number, 4) AS k, sum(number) AS s2 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k) USING k ORDER BY k;
|
||||
SELECT k, s1, s2 FROM (SELECT intDiv(number, 3) AS k, sum(number) AS s1 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k WITH TOTALS) ANY LEFT JOIN (SELECT intDiv(number, 4) AS k, sum(number) AS s2 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k) USING k ORDER BY k;
|
||||
SELECT k, s1, s2 FROM (SELECT intDiv(number, 3) AS k, sum(number) AS s1 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k) ANY LEFT JOIN (SELECT intDiv(number, 4) AS k, sum(number) AS s2 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k WITH TOTALS) USING k ORDER BY k;
|
||||
SELECT k, s1, s2 FROM (SELECT intDiv(number, 3) AS k, sum(number) AS s1 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k WITH TOTALS) ANY LEFT JOIN (SELECT intDiv(number, 4) AS k, sum(number) AS s2 FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY k WITH TOTALS) USING k ORDER BY k;
|
Loading…
Reference in New Issue
Block a user