在SQL中用存储打印乘法口诀
时间:2010-09-26 来源:风云无敌术
create procedure OneToNine
as
declare @x int
set @x=1
while (@x<=9)
begin
declare @y int
set @y=@x
while(@y>=@x)
begin
print convert(varchar(1),@x)+'*'+convert(varchar(1),@y)+'='+convert(varchar(2),@x*@y)
set @y=@y+1
if(@y>9)
break
end
set @x=@x+1
print char(10)+char(13) -------换一段
end
go
exec OneToNine
相关阅读 更多 +