यहां REGEXP_REPLACE
. का उपयोग करके एक संभावित समाधान दिया गया है समारोह:
-- 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;
आउटपुट:
CITY CITY_FORMATTED
------------------ --------------------
st. triple space st. triple space
st. double space st. double space
st. ulrich st. ulrich
st.paul st. paul