I need to select from a table, but remove various strings. Let's say entries in my table are:
DataMart1:Here is some data and other valuable data
HouseWareMart Other data possibly junk data
DataLake3 there is nothing here
And I want to remove various strings: "Valuable data" "Other data " "there is nothing "
So I would get:
DataMart1:Here is some data and other
HouseWareMart possibly junk data
DataLake3 here
I thought about nesting OREPLACE, but couldn't get the syntax right, and searching 'Nested OREPLACE' returned nothing helpful.
Any suggestions?
The syntax for nested replace:
select oreplace(oreplace(oreplace(col, 'Valuable data', ''), 'Other data ', ''), 'there is nothing ', '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With