I have sample data that looks like the following:
fname | lname |
---|---|
x abc | jkn |
test | test gth |
yg-txs | gb@y |
Need to write simple query to
- remove all special character and spaces,
- concat fname and lname
- put it in fullname column, whereas values contained in this field must be without spaces and special characters.
Need optimized query because we have millions of data.
"Expected Output":
fname | lname | fullname |
---|---|---|
x abc | jkn | xabcjkn |
test | test gth | testtestgth |
yg-txs | gb@y | ygtxsgby |
I have tried below it didn't work:
REGEXP_REPLACE({column}, '[^0-9a-zA-Z ]', '')
(REPLACE(CONCAT(fname,lname), '[$!&*_;:@#+\'=%^,<.>/?|~-]', '')