Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Need guidance in removing + in the result using REGEXP

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 :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading