虚位以待(AD)
虚位以待(AD)
首页 > 数据库 > DB2数据库 > DB2把整型转换成制定长度的字符串,前面补0

DB2把整型转换成制定长度的字符串,前面补0
类别:DB2数据库   作者:码皇   来源:互联网   点击:

DB2把整型转换成制定长度的字符串,前面补0select a auto_id,right(digits(cast(auto_id as bigint)),18) from T_BZ_DEMO_AREA_APP a;digits必须使用整型参数。 www 2cto com auto_id类型为:small int

DB2把整型转换成制定长度的字符串,前面补0   select a.auto_id,right(digits(cast(auto_id as bigint)),18)  from T_BZ_DEMO_AREA_APP a; digits必须使用整型参数。   www.2cto.com   auto_id类型为: small integer :返回5位字符串。 large integer :返回10位字符串。 big integer   :返回19位字符串。   如果需要的字符串长度不是上面这些长度,需要使用right函数来获取右边的字符串长度。
 
相关热词搜索: 整型 转换成 制定