format:csv
parses CSV (default),format:json
parses either:
- an array of objects each of which represents a row, or
- an object with fields
columns
& data
, where columns
take an array of column names and data
takes an array of arrays.
WITH table_0 AS (
SELECT
'1' AS a,
'2' AS b,
'3' AS c
UNION
ALL
SELECT
'4' AS a,
'5' AS b,
'6' AS c
)
SELECT
a,
b,
c,
b + c AS d,
42 AS answer
FROM
table_0 AS table_1
WITH table_0 AS (
SELECT
'uk' AS country_code,
'C' AS format
UNION
ALL
'us' AS country_code,
UNION
ALL
SELECT
'lr' AS country_code,
'F' AS format
UNION
ALL
SELECT
'de' AS country_code,
'C' AS format
),
temp_format_lookup AS (
SELECT
country_code,
format
FROM
table_0 AS table_1
)
SELECT
temperatures.*,
temp_format_lookup.country_code,
temp_format_lookup.format
FROM
temperatures
JOIN temp_format_lookup ON temperatures.country_code = temp_format_lookup.country_code
WITH table_0 AS (
SELECT
1 AS a,
'x' AS b,
false AS c
UNION
ALL
SELECT
4 AS a,
NULL AS c
),
x AS (
SELECT
a,
b,
c
FROM
table_0 AS table_1
),
table_2 AS (
SELECT
1 AS a,
'5' AS m
UNION
ALL
SELECT
4 AS a,
NULL AS m
),
y AS (
SELECT
a,
m
FROM
table_2 AS table_3
)
SELECT
x.a,
x.b,
x.c,
y.a,
y.m
FROM
JOIN y ON x.a = y.a