select sum(grade) sum_grade from stu swhere s.id in(select t1.id from stu t1 inner join stu t2on t1.id=t2.c_id);select * from stu;