没有任何的规则吗
如果是这样的,那我给你一个方法

create table aa(id,dd,tt,ff,hh,yy)1,insert into aa(dd,tt) select dd ,tt from table1
2,用游标更改新表aa
upate aa set ff=table2.ff,hh=table2.hh,yy=table2.yy from table2

解决方案 »

  1.   

    select a.dd,a.tt,b.ff,b.hh,b.yy
      from a cross join b
      

  2.   


    select rank,ff,hh,yy  into #test1 from 
     (select rank=count(*),t1.ff,t1.hh,t1.yy from test1 t1,test1 t2 where t1.ff>=t2.ff group by t1.ff,t1.hh,t1.yy )aselect rank ,dd,tt into #test2 from 
    (select rank= count(*),t1.dd,t1.tt from test2 t1, test2 t2 where t1.dd>=t2.dd group by t1.dd,t1.tt)aselect dd,tt,ff,hh,yy into #test3 from
    (select  *  from #test2 left join #test1 on #test2.rank =#test1.rank)aselect a.dd ,a.tt,b.ff,b.hh,b.yy from #test2 a left join #test1 b on  a.rank=b.rank有點亂,呵呵
      

  3.   

    --规则就是按堆顺序连接,是吗,如果这样,只好取到表变量里了。
    declare @_a table( id1 int identity(1,1) ,dd int ,tt int )
    declare @_b table( id2 int identity(1,1) ,ff int ,hh int ,yy int )
    insert into @_a ( dd , tt) select * from a
    insert into @_b ( ff, hh,yy) select * from b
    select dd ,tt , ff, hh ,yy from @_a left join @_b on id1 = id2
      

  4.   

    很笨的方法,有好的寫法告訴我一下MSN:[email protected]
    字段DD,ff不能夠重復,重復的法加強比較條件