在sql中怎样把int行转化成我想要的格式,比如把1转化为'001',

如果数儿都小于1000,可以substring(convert(varchar(30),1000+整数字段),2,3);同理,如果都小于10000,且按4位对齐(1→0001),则substring(convert(varchar(30),10000+整数字段),2,4)

原文地址:https://www.cnblogs.com/forthelichking/p/5163837.html