SELECT DISTINCT s.student_num, s.student_name, '计算机学院' AS college_name, c.class_name, FROM student_info s JOIN classes c ON s.college_id = c.college_id JOIN volunteer_time_table_item t ON s.student_num = t.student_num JOIN volunteer_time_table vtt ON vtt.id = t.volunteer_time_table_id WHERE c.college_id = 1 AND s.level = 2021 AND t.deleted = 0 AND s.deleted = 0 AND vtt.deleted = 0 AND c.deleted = 0 ORDER BY t.volunteer_time_value DESC LIMIT 5;哪里有问题
时间: 2023-06-23 17:08:53 浏览: 110
在SELECT语句中,'计算机学院' AS college_name后面有一个逗号,应该将逗号删除,修改后的语句如下:
SELECT DISTINCT s.student_num, s.student_name, '计算机学院' AS college_name, c.class_name FROM student_info s JOIN classes c ON s.college_id = c.college_id JOIN volunteer_time_table_item t ON s.student_num = t.student_num JOIN volunteer_time_table vtt ON vtt.id = t.volunteer_time_table_id WHERE c.college_id = 1 AND s.level = 2021 AND t.deleted = 0 AND s.deleted = 0 AND vtt.deleted = 0 AND c.deleted = 0 ORDER BY t.volunteer_time_value DESC LIMIT 5;
阅读全文