SELECT REPLACE('hello', 'e', NULL)
-- returns NULL
SELECT REPLACE('hello', '5', NULL)
-- also returns NULL -- here I'd expect it does nothing since there is no '5' in 'hello'
The documentation clearly states:
Returns NULL if any one of the arguments is NULL.
So the behavior is explained.
Is there a workaround, meaning if a pattern is found in a string like 'e' in hello ; a NULL value is emitted?
hello, then what should the output be?