mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-08 23:42:02 +00:00
17 lines
182 B
Plaintext
17 lines
182 B
Plaintext
SELECT
|
|
a,
|
|
b AS x
|
|
FROM `table` AS t
|
|
INNER JOIN table2 AS t2 ON t.id = t2.t_id
|
|
WHERE 1 = 1
|
|
;
|
|
|
|
SELECT
|
|
a,
|
|
b AS x,
|
|
if(x = 0, a, b)
|
|
FROM table2 AS t
|
|
WHERE t.id != 0
|
|
;
|
|
|