這是我的查詢,它顯示兩次具有相同信息的數據。我應該怎麼做纔會顯示一次數據?SQL Server 2008我該怎麼做才能讓它不顯示數據兩次?
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
請幫我:( – 2013-03-13 03:40:53
如果你找到答案,請更新的問題鑑於你已經表明,它應該清楚地返回記錄什麼,我覺得可能是東西。還沒有提供,但我不知道還有什麼要問的。 – TEEKAY 2013-03-13 15:46:46