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

求助:关于一个简单的SQL语句的问题
我需要往gridview里绑定数据,现在语句如下:
SELECT Elect.stuID, Student.stuName, Elect.Score FROM Elect INNER JOIN Student ON Elect.stuID = Student.stuID WHERE (Elect.courceID = @courceID)

现在我需要在把Homework表里的uploadFile 也绑定进去 homework表里有stuID,homework,uploadFile,其中要求
Elect.stuID = Student.stuID=homework.stuID

------解决方案--------------------
SQL code
SELECT Elect.stuID, Student.stuName, Elect.Score, Homework.uploadFile
FROM Elect 
INNER JOIN Student ON Elect.stuID = Student.stuID 
INNER JOIN Homework ON Elect.stuID = homework.stuID
WHERE (Elect.courceID = @courceID)