select a.auto_id,right(digits(cast(auto_id as bigint)),18) from T_BZ_DEMO_AREA_APP a;
digits必须使用整型参数。
auto_id类型为:
small integer :返回5位字符串。
large integer :返回10位字符串。
big integer :返回19位字符串。
如果需要的字符串长度不是上面这些长度,需要使用right函数来获取右边的字符串长度。
原贴地址:http://www.cnblogs.com/kfarvid/archive/2009/11/23/1608842.html
digits必须使用整型参数。
auto_id类型为:
small integer :返回5位字符串。
large integer :返回10位字符串。
big integer :返回19位字符串。
如果需要的字符串长度不是上面这些长度,需要使用right函数来获取右边的字符串长度。
原贴地址:http://www.cnblogs.com/kfarvid/archive/2009/11/23/1608842.html
本文详细介绍了如何在SQL查询中使用digits函数获取auto_id字段特定长度的字符串,包括smallinteger、largeinteger和biginteger类型的具体应用实例。
5427

被折叠的 条评论
为什么被折叠?



