I have a table like this:
Address | Remove1 | Remove2 | Remove3
-------------------------------------------------------------
100 Street, City, State Zip | Street | City | State
I want output like this:
Address | Remove1 | Remove2 | Remove3 | OutputCol
------------------------------------------------------------------------------
100 Street, City, State Zip | Street | City | State | 100 *, *, * Zip
Basically I want to replace the text in Address Column matching on multiple remove columns with '*'
I have tried using REGEXP_REPLACE and REPLACE functions but both of them are giving partial results.
Is there a way I can use the REGEXP_REPLACE(Address, (Remove1|Remove2|Remove3) , '*', 'g') ?