select xuehao as 学号,score as 总成绩 from CJBwhere xuehao in(select xuehao from XSB)group by xuehao,scoreorder by score desc,xuehao
select id as 学号, sum(score) as 总成绩from 成绩表group by idorder by sum(score) desc, id asc