爲什麼會收到一個語法錯誤,因爲這樣的:「作爲」不正確的語法「爲」關鍵字附近
我使用Microsoft Visual Studio 2005和SQL Server 2005
string strSql =
"SELECT a.MCode, a.NameOfModule, a.Mod_Abbreviation, dt.ModuleCode,
dt.Course, dt.Stage, dt.ModuleGrpFrom, dt.ModuleGrpTo, dt.GrpName,
dt.GrpType, dt.StaffID, dt.AcadYear, dt.AcadSemester,
dt.TotalHour, dt.WeeklyLectHr, dt.WeeklyPractHr, dt.WeeklyTutHr,
dt.ModuleLeader, 0 AS TotalTeach, '' AS ModuleGroups, '' AS ML, 0 AS L, 0 AS P, 0 AS T, 1 AS NofGrp, '' AS TotalTeachUnit" +
"FROM (SELECT * FROM
(SELECT a.ModuleCode, a.Course, a.Stage, a.ModuleGrpFrom,
a.ModuleGrpTo, a.GrpName, a.GrpType, a.StaffID, b.AcadYear,
b.AcadSemester, b.TotalHour, b.WeeklyLectHr, b.WeeklyPractHr,
b.WeeklyTutHr, b.ModuleLeader
FROM ModuleStrGrp a
LEFT JOIN ModuleStr b ON a.AcadYear = b.AcadYear
AND a.AcadSemester = b.AcadSemester
AND a.Course = b.Course
AND a.ModuleCode = b.ModuleCode) AS MSG
INNER JOIN Parameter Para ON MSG.Course = Para.Paracode2) AS dt
LEFT JOIN Module a ON dt.ModuleCode = a.MCode" +
"WHERE dt.AcadYear LIKE AcadYear AND dt.AcadSemester LIKE AcadSemester
AND dt.Course LIKE Course AND dt.Stage LIKE Stage AND dt.StaffID LIKE Staff
AND dt.SpecGrp LIKE Specialisation" +
"ORDER BY dt.ModuleCode, dt.GrpType";
你能成爲一個更具體一點?你是否嘗試過測試每個作業,或者我們必須爲你做這件事嗎? – 2009-11-10 07:48:43