'In Trino (Presto) SQL, how do you convert an array of characters (char) into a varchar (string)?
I want to take an array of characters, for example, ['t','e','s','t','🏈'] and turn it into a string; in this case 'test🏈'.
Solution 1:[1]
Here's one way to do this: use ARRAY_JOIN with a blank string:
SELECT ARRAY_JOIN(ARRAY ['t','e','s','t','?'], '') as new_string;
| # | new_string |
|---|---|
| 1 | test? |
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Will Fitzgerald |
