我正在尝试生成一个查询,只要输入我的代码,就会生成缺席学生列表。我遇到的问题是输出列表没有显示课堂上学生的姓名。我的目标是仅根据最近记录的出勤日期列出超过30天的学生。不超过30天的学生将不会出现。看起来很简单但是我遇到了一个障碍。我缺少一个或两个语法吗?
SELECT trim(concat(name.fname,' ' ,name.mname,' ',name.lname)) as student, name.noiid as stuID, sum(meeting.meefoiid) as NO_CLASS, squadlt.ltfname as Squad
FROM name
LEFT JOIN meeting ON name.foiid = meeting.meefoiid
LEFT JOIN squadlt ON name.squadlt = squadlt.ltid
WHERE meeting.meefoiid IS NULL
AND MEEDATE >= '2014-09-12'
AND name.city = 'RICHMOND'
GROUP BY student
ORDER BY name.squadlt, student;