2020-06-20 11:29:01 +00:00
|
|
|
SET send_logs_level = 'fatal';
|
2018-12-18 18:43:06 +00:00
|
|
|
|
2015-07-25 11:59:21 +00:00
|
|
|
SELECT (SELECT (SELECT (SELECT (SELECT (SELECT count() FROM (SELECT * FROM system.numbers LIMIT 10)))))) = (SELECT 10), ((SELECT 1, 'Hello', [1, 2]).3)[1];
|
2015-07-26 07:08:46 +00:00
|
|
|
SELECT toUInt64((SELECT 9)) IN (SELECT number FROM system.numbers LIMIT 10);
|
2015-07-26 10:40:32 +00:00
|
|
|
SELECT (SELECT toDate('2015-01-02')) = toDate('2015-01-02'), 'Hello' = (SELECT 'Hello');
|
|
|
|
SELECT (SELECT toDate('2015-01-02'), 'Hello');
|
|
|
|
SELECT (SELECT toDate('2015-01-02'), 'Hello') AS x, x, identity((SELECT 1)), identity((SELECT 1) AS y);
|
2019-02-12 10:09:03 +00:00
|
|
|
-- SELECT (SELECT uniqState(''));
|
|
|
|
|
2024-05-30 12:27:25 +00:00
|
|
|
SELECT ( SELECT throwIf(1 + dummy) ); -- { serverError FUNCTION_THROW_IF_VALUE_IS_NON_ZERO }
|
2021-07-16 13:38:35 +00:00
|
|
|
|
|
|
|
-- Scalar subquery with 0 rows must return Null
|
|
|
|
SELECT (SELECT 1 WHERE 0);
|
|
|
|
-- But tuple and array can't be inside nullable
|
2024-05-30 12:27:25 +00:00
|
|
|
SELECT (SELECT 1, 2 WHERE 0); -- { serverError INCORRECT_RESULT_OF_SCALAR_SUBQUERY }
|
|
|
|
SELECT (SELECT [1] WHERE 0); -- { serverError INCORRECT_RESULT_OF_SCALAR_SUBQUERY }
|
2021-07-16 13:38:35 +00:00
|
|
|
-- Works for not-empty casle
|
|
|
|
SELECT (SELECT 1, 2);
|
|
|
|
SELECT (SELECT [1]);
|
|
|
|
-- Several rows
|
2024-05-30 12:27:25 +00:00
|
|
|
SELECT (SELECT number FROM numbers(2)); -- { serverError INCORRECT_RESULT_OF_SCALAR_SUBQUERY }
|