ClickHouse/tests/queries/0_stateless/02376_analyzer_in_function_subquery.reference
2022-10-24 10:22:21 +02:00

44 lines
1.1 KiB
Plaintext

-- { echoOn }
SELECT id, value FROM test_table WHERE 1 IN (SELECT 1);
0 Value_0
1 Value_1
2 Value_2
SELECT '--';
--
SELECT id, value FROM test_table WHERE 0 IN (SELECT 1);
SELECT '--';
--
SELECT id, value FROM test_table WHERE id IN (SELECT 1);
1 Value_1
SELECT '--';
--
SELECT id, value FROM test_table WHERE id IN (SELECT 2);
2 Value_2
SELECT '--';
--
SELECT id, value FROM test_table WHERE id IN test_table_for_in;
0 Value_0
1 Value_1
SELECT '--';
--
SELECT id, value FROM test_table WHERE id IN (SELECT id FROM test_table_for_in);
0 Value_0
1 Value_1
SELECT '--';
--
SELECT id, value FROM test_table WHERE id IN (SELECT id FROM test_table_for_in UNION DISTINCT SELECT id FROM test_table_for_in);
0 Value_0
1 Value_1
SELECT '--';
--
WITH cte_test_table_for_in AS (SELECT id FROM test_table_for_in) SELECT id, value FROM test_table WHERE id IN cte_test_table_for_in;
0 Value_0
1 Value_1
SELECT '--';
--
WITH cte_test_table_for_in AS (SELECT id FROM test_table_for_in) SELECT id, value
FROM test_table WHERE id IN (SELECT id FROM cte_test_table_for_in UNION DISTINCT SELECT id FROM cte_test_table_for_in);
0 Value_0
1 Value_1