这是我的查询,它两次显示具有相同信息的数据。我应该怎么做,它只会显示一次数据?
SELECT
STUDENT.Stud_Num, STUDENT.Last_Name, STUDENT.First_Name,
STUDENT.Middle_Name, STUDENT.Program, CORRELATION.Corr_Code,
AVERAGE.Remarks, ACAD_QTR_LINK.Acad_Year, ACAD_QTR_LINK.Qtr,
COURSE.Course_Name, GRADES.Grades, GRADES.[No.OfTakes]
FROM
STUDENT
inner join
AVERAGE on STUDENT.Stud_Num = AVERAGE.Stud_Num
inner join
CORRELATION on AVERAGE.Corr_Code = CORRELATION.Corr_Code
inner join
ACAD_QTR_LINK on AVERAGE.Acad_Qtr_ID = ACAD_QTR_LINK.Acad_Qtr_ID
inner join
CORR_COUR_LINK on STUDENT.Stud_Num = CORR_COUR_LINK.Stud_Num
inner join
COURSE on CORR_COUR_LINK.Course_Code = COURSE.Course_Code
inner join
GRADES on CORR_COUR_LINK.Corr_Cour_ID = GRADES.Corr_Cour_ID
where
STUDENT.Stud_Num like '%' and STUDENT.Program like '%'
and STUDENT.Last_Name like '%' and STUDENT.First_Name like '%'
and STUDENT.Middle_Name like '%' and ACAD_QTR_LINK.Acad_Year like '%'
and ACAD_QTR_LINK.Qtr like '%'
and COURSE.Course_Name like '%' and CORRELATION.Corr_Code like '%'
结果输出:
|StudNum|LName|FName|MName|Prog|CorrCode|Remarks|AcadYr|Qtr|CorName|Grades|No.OfTakes
|2007131|Mendo|charisn|Chucka|ECE|ece12345|7.00000| '11-'12 |3rd|Mathema|89.000| 1
|2007131|Mendo|charisn|Chucka|ECE|ece12345|7.00000| '11-'12 |3rd|Mathema|89.000| 1
|2007131|Mendo|charisn|Chucka|ECE|ece12345|7.00000| '11-'12 |3rd|Electroni|65.000| 1
|2007131|Mendo|charisn|Chucka|ECE|ece12345|7.00000| '11-'12 |3rd|Electroni|65.000| 1