Her er en mulig løsning ved at bruge REGEXP_REPLACE
funktion:
-- Match the string "st." followed by zero or more spaces and a word character,
-- replace it with "st." followed by exactly one space and the captured character
select city,
regexp_replace(city, 'st\.\s*(\w)', 'st. \1' ) as city_formatted
from t
order by city;
Output:
CITY CITY_FORMATTED
------------------ --------------------
st. triple space st. triple space
st. double space st. double space
st. ulrich st. ulrich
st.paul st. paul