Hola a todos
Tengo esta consulta pero necesito agregarle para que me muestre también la ultima fecha de acceso a la plataforma
Me podrían ayudar. Gracias
SELECT
z.name,
a.idnumber id_curso,
a.fullname nombre_curso,
SUBSTRING_INDEX(SUBSTRING_INDEX(a.fullname, '|', 3), '|', -1) id_bloque,
d.username cedula,
d.idnumber cod_estudiante,
d.firstname nombres,
d.lastname apellidos,
d.email,
g.name as rol,
h.itemmodule as tipo_actividad,
h.itemname as actividad,
h.grademax as puntos_posibles,
i.finalgrade as calificacion,
from_unixtime(i.timemodified) as fecha_enviada
FROM mdl_grade_items h
INNER JOIN mdl_course a ON a.id = h.courseid AND a.idnumber like '20223%'
INNER JOIN mdl_enrol b ON a.id = b.courseid
INNER JOIN mdl_user_enrolments c ON b.id = c.enrolid AND c.status = 0
INNER JOIN mdl_user d ON c.userid = d.id AND d.suspended = 0
INNER JOIN mdl_context e ON a.id = e.instanceid AND contextlevel = '50'
INNER JOIN mdl_role_assignments f ON e.id = f.contextid AND d.id = f.userid
INNER JOIN mdl_role g ON f.roleid = g.id AND g.id = '5'
INNER JOIN mdl_course_categories z ON a.category = z.id
LEFT JOIN mdl_grade_grades i ON i.itemid = h.id AND i.userid = d.id
WHERE h.itemmodule is not null AND h.grademax > 0 AND h.itemname like 'Semana %'
ORDER BY a.idnumber DESC