mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 21:51:57 +00:00
97f2a2213e
* Move some code outside dbms/src folder * Fix paths
15 lines
733 B
SQL
15 lines
733 B
SQL
SELECT 1 ? 1 : 0;
|
|
SELECT 0 ? not_existing_column : 1 FROM system.numbers LIMIT 1;
|
|
SELECT 1 ? (0 ? not_existing_column : 2) : 0 FROM system.numbers LIMIT 1;
|
|
|
|
/* scalar subquery optimization */
|
|
SELECT (SELECT toUInt8(number + 1) FROM system.numbers LIMIT 1) ? 1 : 2 FROM system.numbers LIMIT 1;
|
|
|
|
/* alias test */
|
|
SELECT (1 as a) ? (2 as b) : (3 as c) as d, a, b, c, d FORMAT TSKV;
|
|
SELECT (0 as a) ? (2 as b) : (3 as c) as d, a, b, c, d FORMAT TSKV;
|
|
|
|
SELECT (1 as a) ? (number + 2 as b) : (number + 3 as c) as d, a, b, c, d FROM system.numbers LIMIT 1 FORMAT TSKV;
|
|
|
|
/* intergration test */
|
|
SELECT (SELECT hasColumnInTable('system', 'numbers', 'not_existing')) ? not_existing : 42 as not_existing FROM system.numbers LIMIT 1 FORMAT TSKV; |