日期:2014-05-17 浏览次数:20475 次
select s.姓名,c1.班级名称 as 原班级名称,c.班级名称 as 新班级名称
from student_change SC
inner join students S on sc.student_id=s.student_id
inner join classes C on c.class_id = sc.新班级编号
inner join classes C1 on c1.class_id = s.班级编号
select s.姓名,
(select c1.班级名称 from classes C
where c.class_id = sc.新班级编号) as 原班级名称,
(select c.班级名称 from classes C1
where c1.class_id = s.班级编号) as 新班级名称
from student_change SC
inner join students S on sc.student_id=s.student_id