How can I remove/replace a specific character from a string of text?
AnsweredExample 1:
A field contains a comma and I wish to change that to a ~ instead.
Here you would use the substring_before and concat functions in the Cloud9QL box, as follows::
select *, concat(substring_before(<field_name>,,), ~) as replaced
Example 2:
A field that contains the letter X and I want to remove it completely:
Here you can use the concat, substring_before and substring_after functions in the Cloud9QL box, as follows:
select *, concat(substring_before(<field_name>,<character to remove/replace>),substring_after(<field_name>,<character to remove/replace>)) as removed
Please sign in to leave a comment.
0 comments