SELECT username
FROM prefix_user
WHERE id =
(SELECT studentid
FROM
(SELECT studentid
FROM prefix_attendance_log
WHERE statusid =
(SELECT id
FROM prefix_attendance_statuses
WHERE description='Absent') )
AS abstu
LEFT join
(SELECT studentid
FROM prefix_attendance_log
WHERE statusid =
(SELECT id
FROM prefix_attendance_statuses
WHERE description !='Absent') )
AS notabstu
USING studentid
WHERE notabstu.studentid IS NULL)
can anyone please find the error in this. the error shown is as:
Error when executing the query: Error reading from database You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'studentid WHERE notabstu.studentid IS NULL) LIMIT 0, 2' at line 21 SELECT username FROM mdl_user WHERE id = (SELECT studentid FROM (SELECT studentid FROM mdl_attendance_log WHERE statusid = (SELECT id FROM mdl_attendance_statuses WHERE description='Absent') ) AS abstu LEFT join (SELECT studentid FROM mdl_attendance_log WHERE statusid = (SELECT id FROM mdl_attendance_statuses WHERE description !='Absent') ) AS notabstu USING studentid WHERE notabstu.studentid IS NULL) LIMIT 0, 2 [array ]