时间:2021-07-01 10:21:17 帮助过:29人阅读
上班无聊,写着玩玩,不太了解SQL-SERVER,请大家指点。 无 declare @i intdeclare @j intdeclare @str varchar(20)set @i = 123while @i 999/3beginselect @str = convert(varchar,@i) +' '+ convert(varchar,@i*2)+' '+ convert(varchar,@i*3), @j = 1, @i
上班无聊,写着玩玩,不太了解SQL-SERVER,请大家指点。 <无>declare @i int declare @j int declare @str varchar(20) set @i = 123 while @i < 999/3 begin select @str = convert(varchar,@i) +' '+ convert(varchar,@i*2)+' '+ convert(varchar,@i*3), @j = 1, @i = @i + 1 while @j <= 9 begin if charindex(convert(varchar,@j),@str) <= 0 break set @j = @j + 1 end if @j >= 10 print @str end