Ï൱ÓÚVBÀïµÄÓï¾ä For inti=1 to 9 debug.print format(inti,"000#") NextSQL code: right(×Ö¶ÎÃû£¬4)
SQL code: declare @i int set @i=1 while @i<10000 begin print right('000'+ltrim(@i),4); set @i=@i+1; end
SQL code:
DECLARE @i int DECLARE @tb table (val varchar(4)) set @i = 0 while @i < 1000 begin insert into @tb SELECT REPLICATE('0', 4 - LEN(LTRIM(@i))) + LTRIM(@i) set @i = @i + 1 end select * from @tb
Ê÷¸ç»ØÀ´ÁË¡£¡£¡£ SQL code:
declare @table table (id int) insert into @table select 1 union all select 2 union all select 3 union all select 4 union all select 5 union all select 6 union all select 7 union all select 8 union all se