不懂,这算什么连接?
只要把b里面有的数据放在表A最上面,表A后面多出来的都为空?

解决方案 »

  1.   

    to mgsray(我是新新新新,新来的吧) 
    就是这个要求。请帮忙。
      

  2.   

    select identity(int,1,1) as id ,* into #t1 from a
    select identity(int,1,1) as id ,* into #t2 from b
    select code, name, class, point from #t1 a left join #t2 b on a.id=b.id
      

  3.   

    不会吧,表B没有code这个字段??那靠什么关联呀?
    假设有这个字段
    SELECT A.*,B.* from A LEFT OUTER JOIN B ON A.code=B.code
      

  4.   

    select id=identity(int),* into #t from 表B
    select a.*,b.class,b.point
    from 表A a
    left join #t b on b.id=(select count(*) from 表A where code<=a.code)
    drop table #t
      

  5.   

    select *
    from 表A a
    left join 表B b 
    on (select count(*) from 表A where code<=a.code)
    =(select count(*) from 表B where class<=b.class)