T-SQL 解决"易语言难题"

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
赞 (0) 评论 分享 ()