dbms: JOINs: added tests [#METR-11370].

This commit is contained in:
Alexey Milovidov 2014-06-19 23:00:19 +04:00
parent b970c85546
commit 7c0f53c34f
8 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,10 @@
0 0
1 0
2 1
3 0
4 2
5 0
6 3
7 0
8 4
9 0

View File

@ -0,0 +1,9 @@
SELECT *, joined FROM
(
SELECT number AS k FROM system.numbers LIMIT 10
)
ANY LEFT JOIN
(
SELECT number * 2 AS k, number AS joined FROM system.numbers LIMIT 10
)
USING k;

View File

@ -0,0 +1,5 @@
0 0
2 1
4 2
6 3
8 4

View File

@ -0,0 +1,9 @@
SELECT *, joined FROM
(
SELECT number AS k FROM system.numbers LIMIT 10
)
ANY INNER JOIN
(
SELECT number * 2 AS k, number AS joined FROM system.numbers LIMIT 10
)
USING k;

View File

@ -0,0 +1,15 @@
0 0
0 1
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9
5 0
6 0
7 0
8 0
9 0

View File

@ -0,0 +1,9 @@
SELECT *, joined FROM
(
SELECT number AS k FROM system.numbers LIMIT 10
)
ALL LEFT JOIN
(
SELECT intDiv(number, 2) AS k, number AS joined FROM system.numbers LIMIT 10
)
USING k;

View File

@ -0,0 +1,10 @@
0 0
0 1
1 2
1 3
2 4
2 5
3 6
3 7
4 8
4 9

View File

@ -0,0 +1,9 @@
SELECT *, joined FROM
(
SELECT number AS k FROM system.numbers LIMIT 10
)
ALL INNER JOIN
(
SELECT intDiv(number, 2) AS k, number AS joined FROM system.numbers LIMIT 10
)
USING k;