表Student:字段: studentId,name,depart( 专业)
表Lesson(课程表): 字段:lessionId,lessonName
表score(分数表): 字段: studentId,lessonId,score写出SQL:列出 考试科目名称为‘java语言’ 的科目分数为前十名的学生studentId,name,depart.
表Lesson(课程表): 字段:lessionId,lessonName
表score(分数表): 字段: studentId,lessonId,score写出SQL:列出 考试科目名称为‘java语言’ 的科目分数为前十名的学生studentId,name,depart.
select a.studentId,a.name,a.depart from Student a, Lesson b, score c where a.studentId=c.studentId and c.lessonId=b.lessonId and b.lessonName='java语言' order by c.score desc limit 10;
select * from Student where studentId in(
select studentId from lesson l,score s where l.lessonId=s.lessonId and l.lessonName='java语言' order by s.score desc limit 1,10
)
oracle和sqlserver就是最后取得的分页语句不一样,分页语句见:http://www.javaeye.com/topic/59506