insert into fourclass(成绩) select 成绩 from  allclass where fourclass.姓名=allclass.姓名

解决方案 »

  1.   

    update fourclass set 成绩=a.成绩 from  allclass a  where fourclass.姓名=a.姓名
      

  2.   

    也可以用更新语句:
    update a set a.成绩= b.成绩  from fourclass a,allclass b where a.姓名=b.姓名
      

  3.   


    update FC
    set FC.成績=AC.成績
    from fourclass FC
    join allclass AC
    on FC.姓名=AC.姓名
      

  4.   

    语句倒是没问题!感觉这种做法不对!一个年级里同名字的人机率太高了吗!用学号的话不是更好!??
    在这个fourclass 表应该有个学号这样的关键字段吧!
    感觉这么写才对阿!
    update fourclass set 成绩=a.成绩 from  allclass a  where a.班级=4 and a.学号= fourclass .学号
      

  5.   

    scmail81(freedom) 说得对,
    我也这样认为,那样设置表是一种不好的设计方案,
    应加一个学号关键字段。
      

  6.   

    这是更新操作,用insert into是不行的.insert into会新建后面的所带的表或表的字段