表1
id xueke score
1 sql 70
2 sql 80
表2
id xueke score
1 .net 90
1 java 80
2 .net 80 select id,sum(score) as sumscore from (
select id ,xueke,score from 表1
union all
select id ,xueke,score from 表2)t
group by id
id xueke score
1 sql 70
2 sql 80
表2
id xueke score
1 .net 90
1 java 80
2 .net 80 select id,sum(score) as sumscore from (
select id ,xueke,score from 表1
union all
select id ,xueke,score from 表2)t
group by id
select id,总分=sum(score)
(
select * from a
union all
select * from b
) a
group by id2。
select *
(
select * from a
union all
select * from b
) a
union all
select 编号,姓名 from 表12答案