Created
November 24, 2022 15:10
-
-
Save mshakhomirov/aac1f93312ae305ba80c915fe4a2a386 to your computer and use it in GitHub Desktop.
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
with mytable as ( | |
select 1 as x, 'foo' as y, true as z union all | |
select 2, 'bar', false | |
) | |
select | |
concat("{", "\"MyTable\":", "[", string_agg(to_json_string(t), ","), "]", "}") | |
from mytable as t | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment