PG возможно выполнить команду:
SELECT * FROM (VALUES(1, 'Moscow'), (2, 'Vladivostok')) AS t (id, city)
и на выходе получить таблицу "t":
id | city
—--+-------------
1 | Moscow
2 | Vladivostok
(2 rows)
SELECT * FROM VALUES('a UInt64, s String', (1, 'one'), (2, 'two'), (3, 'three')) ┌─a─┬─s─────┐ │ 1 │ one │ │ 2 │ two │ │ 3 │ three │ └───┴───────┘ WITH [(1, 'one'), (2, 'two'), (3, 'three')] AS rows_array, arrayJoin(rows_array) AS row_tuple SELECT row_tuple.1 AS number_decimal, row_tuple.2 AS number_string ┌─number_decimal─┬─number_string─┐ │ 1 │ one │ │ 2 │ two │ │ 3 │ three │ └────────────────┴───────────────┘
Обсуждают сегодня