aboutsummaryrefslogtreecommitdiffstats
path: root/yql/essentials/tests/sql/suites/expr/as_table.sql
blob: 8a293d03a9a99d566c58959195316d03d4e14869 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* postgres can not */

$data = AsList(
    AsStruct(1u AS Key, "v1" AS Value1, 100 AS Value2),
    AsStruct(2u AS Key, "v2" AS Value1, 200 AS Value2),
    AsStruct(3u AS Key, "v3" AS Value1, 300 AS Value2));

SELECT Key, Value2 FROM AS_TABLE($data);

$input = (
    SELECT * FROM AS_TABLE($data) WHERE Key > 1
);

SELECT Key, Value1 FROM $input;