日期:2014-05-18  浏览次数:20500 次

使用索引查询语句
如何使用索引查询成绩 谁给举个例子

/*-使用索引查询学生考试成绩-*/
select s.StudentName,j.SubjectName,ExamDate,StudentResult from Student s
 inner join Result r on r.StudentNo=s.StudentNo
 inner join Subject j on j.SubjectNo=r.SubjectNo
where StudentResult between 80 and 90

------解决方案--------------------
是不使索引不是自己决定的,你在where,group by,order by后面出现的字段建索引
查询优化器会自己处理