日期:2014-05-18 浏览次数:20793 次
declare @str varchar(max) declare @num1 int ,@num2 int select @num1=1,@num2=1 while(@num1<10) begin set @num2=1 while(@num2<=@num1) begin set @str = isnull(@str,'')+ltrim(@num1)+'*'+ltrim(@num2)+'='+right(100+@num1*@num2,2)+' ' set @num2=@num2+1 end set @num1=@num1+1 set @str = isnull(replace(@str,'=0','= '),'') + char(13) end print @str