1:Select * into tableB from tableA 2: tableA拿去修改 3: Select * from tableB join tableA on tableA.A = tableB.A where (tableB.B > 0 and tableB.B <> tableA.B) or (tableB.C > 0 and tableB.C <> tableA.C) or (tableB.D > 0 and tableB.D <> tableA.D) or (tableB.E > 0 and tableB.E <> tableA.E)
第一步: 将自己输入的成绩备份。如:table1 A B C D E 001 85 96 002 65 34 003 87 52 第二步: 将各班级后填入的成绩生成表 table2 第三步: update table1 set b=table2.b from table2 where table1.b is null and table1.a=table2.a update table1 set c=table2.c from table2 where table1.c is null and table1.a=table2.a update table1 set d=table2.d from table2 where table1.d is null and table1.a=table2.a update table1 set e=table2.e from table2 where table1.e is null and table1.a=table2.a 现在的table1就是更新后的成绩表
建立觸發器,當用戶update 為 null 的值時不產生update觸發,當update 為 is not null時觸發在另一個表登記.
2: tableA拿去修改
3:
Select * from tableB join tableA on tableA.A = tableB.A
where (tableB.B > 0 and tableB.B <> tableA.B)
or (tableB.C > 0 and tableB.C <> tableA.C)
or (tableB.D > 0 and tableB.D <> tableA.D)
or (tableB.E > 0 and tableB.E <> tableA.E)
将自己输入的成绩备份。如:table1
A B C D E
001 85 96
002 65 34
003 87 52
第二步:
将各班级后填入的成绩生成表 table2
第三步:
update table1 set b=table2.b from table2 where table1.b is null and table1.a=table2.a
update table1 set c=table2.c from table2 where table1.c is null and table1.a=table2.a
update table1 set d=table2.d from table2 where table1.d is null and table1.a=table2.a
update table1 set e=table2.e from table2 where table1.e is null and table1.a=table2.a
现在的table1就是更新后的成绩表