如何替换 sql 中 1 列中缩短的 'str' 和 'av'?
how to replace shortened 'str' and 'av' in 1 column in sql?
sql table 的地址带有 'str' 和 'av' 缩写名称。
我需要让它像 'street' , 'avenue'
Jacob str. 34
5th av.
wall str.67
我需要使用 'replace' 函数,但它不会更改 'av' 如果我只能为 str 指定 1 个占位符。:
select
replace(address, 'str.' , 'street' ) as e
from store_address
如何更改'av'部分?结果列应包括两者。
您可以使用 replace()
两次:
select replace(replace(address, 'str.' , 'street'), 'av.', 'avenue') as e
from store_address
sql table 的地址带有 'str' 和 'av' 缩写名称。 我需要让它像 'street' , 'avenue'
Jacob str. 34
5th av.
wall str.67
我需要使用 'replace' 函数,但它不会更改 'av' 如果我只能为 str 指定 1 个占位符。:
select
replace(address, 'str.' , 'street' ) as e
from store_address
如何更改'av'部分?结果列应包括两者。
您可以使用 replace()
两次:
select replace(replace(address, 'str.' , 'street'), 'av.', 'avenue') as e
from store_address