mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-05 05:52:05 +00:00
18 lines
430 B
SQL
18 lines
430 B
SQL
SET allow_experimental_analyzer = 1;
|
|
|
|
select so,
|
|
r
|
|
from
|
|
(select [('y',0),('n',1)] as cg,
|
|
if( arrayMap( x -> x.1, cg ) != ['y', 'n'], 'y', 'n') as so,
|
|
arrayFilter( x -> x.1 = so , cg) as r
|
|
);
|
|
|
|
select
|
|
r
|
|
from
|
|
(select [('y',0),('n',1)] as cg,
|
|
if( arrayMap( x -> x.1, cg ) != ['y', 'n'], 'y', 'n') as so,
|
|
arrayFilter( x -> x.1 = so , cg) as r
|
|
);
|