postgresql 字符串转整数 int、integer
--把'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')
标签:postgresql,int,number,整数,integer,select From: https://www.cnblogs.com/Fooo/p/17516332.html