mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 08:52:06 +00:00
18 lines
430 B
MySQL
18 lines
430 B
MySQL
|
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
|
||
|
);
|