生成表nums,把1-8000的序号插入表nums

解决方案 »

  1.   

    select top 8000 identity(int,1,1) as N into nums from 
    (select top 100 id=1  from sysobjects) as a,
    (select top 100 id=1  from sysobjects) as b,
    (select top 100 id=1  from sysobjects) as cselect * from 
    (select top 100 id=1  from sysobjects) as a,
    (select top 100 id=1  from sysobjects) as b,
    (select top 100 id=1  from sysobjects) as c
    是全联接
    就是笛卡尔积
    楼主可以比较
    select  top 8000 identity(int,1,1) as N from 
    (select top 100 id=1  from sysobjects) as a,
    (select top 100 id=1  from sysobjects) as b,
    (select top 100 id=1  from sysobjects) as c

    select  top 8000 identity(int,1,1) as N from 
    (select top 10 id=1  from sysobjects) as a,
    (select top 10 id=1  from sysobjects) as b,
    (select top 10 id=1  from sysobjects) as c
    就应该明白了