SQL Server 补位

 

 

select RIGHT(REPLICATE('0',3)+CAST(3 AS varchar(10)),3)
003
select RIGHT(REPLICATE('0',3)+CAST(12 AS varchar(10)),3)
012
select RIGHT(REPLICATE('0',3)+CAST(123 AS varchar(10)),3)
123

 

posted @ 2020-08-14 18:14  三瑞  阅读(788)  评论(0编辑  收藏  举报