嗨,我有这个SELECT查询.我已经尝试在Visual Studio 2008上的SQL窗格上排除查询并且它可以工作.但是,当我运行页面(这是一个asp.net页面)时,它会抛出一个SQL异常,说我在Scheduleles附近有一个不正确的语法.
string selectSchedString = "SELECT Subjects.subject_title, Schedules.class_day, CAST(MIN(Schedules.time_in) AS varchar(10)) + ' - ' + CAST(MAX(Schedules.time_out) AS varchar(10)) AS Expr1" +
"FROM Schedules "+ //The exception points here
"INNER JOIN Subjects ON Schedules.subject_id = Subjects.subject_id " +
"INNER JOIN Student ON Student.section_id = " + currentSection + " " +
"GROUP BY Subjects.subject_title, Schedules.class_day";
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?正如我所说的,我尝试在SQL窗格上将其排除,并且它有效.asp.net中有什么特殊情况我错过了吗?