Code:
select
right(trim('- ' from addresses.phone), 8) as phone_1,
right(trim('-' from addresses.phone), 8) as phone_2,
right(trim(' ' from addresses.phone), 8) as phone_3,
addresses.phone as celular
from addresses
I'm trying to remove the "-" and " " from phone numbers but when I try the characters stay anyway. I've tried it without the right() function and the result is the same. The issue appears to happen when the characters are in between the numbers. Because I could succesfully remove the "+" from a +5491128394716 and the "(" from a (011)37102938 but I was trying to remove "(" and ")" so that is why I suspect that the issue is in between the numbers.
Result: