SELECT ID,
lower(LISTAGG(DISTINCT COL_A, ',') WITHIN GROUP(ORDER BY COL_A)) AS COL_1
FROM table_1
WHERE date = '2022-02-02'
GROUP BY ID
ID COL_1
12345 abc,+bda,+beach,relax
23456 unknown_user,+unknown_member,+others_to_denote
When I run the above query, I’m getting results like mentioned above. I want the + symbol to be removed from the results. Is it possible to use REGEXP in this casE?
>Solution :
if you just want to remove +, then you can use REPLACE
SELECT ID,COL_1, replace(col_1,'+') FROM VALUES
('12345', 'abc,+bda,+beach,relax')
,('23456','unknown_user,+unknown_member,+others_to_denote') as tab(ID,COL_1)