mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-18 13:42:02 +00:00
28 lines
409 B
MySQL
28 lines
409 B
MySQL
|
SELECT *
|
||
|
FROM
|
||
|
(
|
||
|
WITH
|
||
|
|
||
|
(
|
||
|
SELECT groupArray(a)
|
||
|
FROM
|
||
|
(
|
||
|
SELECT 1 AS a
|
||
|
)
|
||
|
) AS keys,
|
||
|
|
||
|
(
|
||
|
SELECT groupArray(a)
|
||
|
FROM
|
||
|
(
|
||
|
SELECT 2 AS a
|
||
|
)
|
||
|
) AS values
|
||
|
SELECT *
|
||
|
FROM
|
||
|
(
|
||
|
SELECT 1 AS a
|
||
|
)
|
||
|
WHERE transform(a, keys, values, 0)
|
||
|
) AS wrap;
|