Reputation: 8703
Given this data:
col1
----
foo
bar
I want concatenate the rows together, and end up with 'foo','bar'. Using collect_set gets me an array, concat_ws gets me a comma separated string. select
concat_ws(',',collect_set(col1))
I cannot figure out how to get the single quotes in there.
concat('''',col1,'''')
just returns the value of col1.
What am I doing wrong?
Upvotes: 1
Views: 8247