science 表
   name  count  other
     a1      5    aa1
     a2      6    aa2
   super 表 
   name  sey 
     b1    5
     b2    6如何将  super表的那么字段所有值插入至science表。插入后结果
   science 表
   name  count  other
     a1      5    aa1
     a2      6    aa2
     b1      
     b2

解决方案 »

  1.   


    declare @science table 
    (name varchar(2),[count] int,other varchar(3))
    insert into @science
    select 'a1',5,'aa1' union all
    select 'a2',6,'aa2'declare @super table (name varchar(2),sey int)
    insert into @super
    select 'b1',5 union all
    select 'b2',6insert into @science(name) select name from @superselect * from @science
    /*
    name count       other
    ---- ----------- -----
    a1   5           aa1
    a2   6           aa2
    b1   NULL        NULL
    b2   NULL        NULL
    */
      

  2.   


    insert into science(name,coun,other)
    select name,coun,other from science