标签:code ber number substring 转换 postgres text lin comment
--把‘1234‘转成整数
select
cast
(
‘1234‘
as
integer
) ;
--用substring截取字符串,从第8个字符开始截取2个字符:结果是12
select
cast
(
substring
(
‘1234abc12‘
,8,2)
as
integer
)
---使用to_number函数来转换成整数
---to_number(text, text) 返回的类型 numeric 把字串转换成numeric to_number(‘12,454.8-‘, ‘99G999D9S‘)
select
to_number(
‘12121‘
,
‘999999999‘
)
标签:code ber number substring 转换 postgres text lin comment
原文地址:https://www.cnblogs.com/telwanggs/p/11056467.html