Created
March 18, 2020 14:11
-
-
Save dz0/3473d72b7f191fb98e5c92f30816b1e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
; nice formatting of https://www.vertica.com/blog/vertica-quick-tip-splitting-string-rows/ | |
=> SELECT * FROM test; | |
id | c2 | |
----+------- | |
1 | A|B|C | |
2 | D|E|F | |
(2 rows) | |
;;;;; | |
=> SELECT id, words FROM ( | |
SELECT id, StringTokenizerDelim(c2, ‘|’) | |
OVER (PARTITION BY id ORDER BY id) | |
FROM test) | |
ORDER BY 1, 2; | |
id | words | |
—-+——- | |
1 | A | |
1 | B | |
1 | C | |
2 | D | |
2 | E | |
2 | F | |
(6 rows) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this!