-
-
Save TobCap/83d6d874f40e265b45cdb0c992317e00 to your computer and use it in GitHub Desktop.
another way of making temporary table by using UNNEST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- refers to https://pod.hatenablog.com/entry/2021/08/04/111107 | |
WITH points AS ( | |
select * from UNNEST(ARRAY<STRUCT<id int, p STRUCT<x int64, y int64>>>[ | |
(1, (0, 10)), | |
(2, (0, 10)), | |
(2, (0, 10)) | |
]) | |
) | |
SELECT * FROM points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "1", | |
"p": { | |
"x": "0", | |
"y": "10" | |
} | |
}, | |
{ | |
"id": "2", | |
"p": { | |
"x": "0", | |
"y": "10" | |
} | |
}, | |
{ | |
"id": "2", | |
"p": { | |
"x": "0", | |
"y": "10" | |
} | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment