Last active
November 2, 2020 17:35
-
-
Save AlexeySoshin/5307667da4bbf008d876e0b6b7f2fea1 to your computer and use it in GitHub Desktop.
Creates virtual table from single string
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
select a[1]::integer as col1, a[2]::integer as col2, a[3]::float as col3, a[4] as col4, a[5] as col5 | |
from ( | |
select string_to_array(nest.l, ',') as a | |
from ( | |
select unnest('{"3,2,82.38,null,World","4,1,43.12,Hello,null"}'::text[]) as l | |
) nest | |
) b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment