双色球(用sql实现)

select * from shuangsq
create table shuangsq(Red1 int,Red2 int,Red3 int,Red4 int,Red5 int,Red6 int,Blue0 int)
declare @r1 int,@r2 int,@r3 int,@r4 int,@r5 int,@r6 int,@b0 int
set @r1=1
while @r1<=28
 begin
  set @r2=@r1+1
  while @r2<=29
   begin
    set @r3=@r2+1
    while @r3<=30
     begin
      set @r4=@r3+1
      while @r4<=31
       begin
        set @r5=@r4+1
        while @r5<=32
         begin
          set @r6=@r5+1
          while @r6<=33
           begin
            set @b0=1
            while @b0<=16
             begin
              insert into shuangsq values(@r1,@r2,@r3,@r4,@r5,@r6,@b0)
              set @b0=@b0+1
             end
            set @r6=@r6+1
           end
          set @r5=@r5+1
         end
        set @r4=@r4+1
       end
      set @r3=@r3+1
     end
    set @r2=@r2+1
   end
  set @r1=@r1+1
end

 



你可能感兴趣的:(Sql,Server)