cnblogs/dcrenl/SQL Server 加前导0.html
2024-09-24 12:43:01 +08:00

5 lines
191 B
HTML

<div>declare @a int</div>
<div>declare @b int</div>
<div>set @a = 1 --需要显示的数字</div>
<div>set @b = 3 --显示位数</div>
<p>select right(cast(power(10,@b) as varchar)+@a,@b)</p>