listar todos los usuarios matriculados con los sin ingreso y los totales de nota y se sacan los duplicados, lo ke me sobren son los pendientes.
entonces la idea es unir las tres query y se listen todos los resultados, entonces de eso se sacann todos los que se repiten y me da los pendientes.
la logica seria totalmatriculados+totalnotas+siningreso-duplicados=pendientes
eso muchas gracias espero que me ayuden
les dejo las querys adjuntas:
Código:
/*Sin Ingreso*/ SELECT /*mdl_course.fullname as Grupo,*/ mdl_user.username as Rut, mdl_user.firstname as Nombre, mdl_user.lastname Apellido, mdl_user.idnumber as Cargo, mdl_user.phone1 as Division, mdl_user.description as Sucursal, mdl_user.icq as Rut_Supervisor, mdl_user.department as Experto, mdl_user.address as Mail_participantes FROM mdl_user, mdl_course WHERE mdl_user.currentlogin = 0 AND mdl_user.lastlogin = 0 AND mdl_user.lastaccess = 0 AND mdl_user.username NOT LIKE '%experto%' and mdl_user.username NOT LIKE '%pnunez%'and mdl_user.username NOT LIKE '%admin%' and mdl_user.username NOT LIKE '%fboeri%' and mdl_user.username NOT LIKE '%jpalacios%' and mdl_user.username NOT LIKE '%ecerda%' and mdl_user.username NOT LIKE '%prueba%'and mdl_user.username NOT LIKE '%fsepulveda%' and mdl_user.username NOT LIKE '%fbarbano%' group BY mdl_user.username
Código:
/* aqui van todos os quiz cuestionarios que están en Tremon*/ select mdl_course.fullname as Grupo, mdl_user.username as Rut, mdl_user.firstname as Nombre, mdl_user.lastname Apellido, mdl_quiz_grades.grade as Nota, mdl_user.idnumber as Cargo, mdl_user.phone1 as Division, mdl_user.description as Sucursal, mdl_user.icq as Rut_Supervisor, mdl_user.department as Experto, mdl_user.address as Mail_participantes from mdl_quiz_grades, mdl_quiz, mdl_user , mdl_course where mdl_quiz_grades.quiz = mdl_quiz.id AND mdl_quiz_grades.userid = mdl_user.id AND mdl_quiz.course = mdl_course.id AND (mdl_quiz_grades.quiz = 13 OR mdl_quiz_grades.quiz = 14 OR mdl_quiz_grades.quiz = 15 OR mdl_quiz_grades.quiz = 16 OR mdl_quiz_grades.quiz = 17 )AND mdl_user.username NOT LIKE '%experto%' and mdl_user.username NOT LIKE '%pnunez%'and mdl_user.username NOT LIKE '%admin%' and mdl_user.username NOT LIKE '%fboeri%' and mdl_user.username NOT LIKE '%jpalacios%' and mdl_user.username NOT LIKE '%ecerda%' and mdl_user.username NOT LIKE '%prueba%'and mdl_user.username NOT LIKE '%fsepulveda%' and mdl_user.username NOT LIKE '%fbarbano%' ORDER BY mdl_course.fullname
Cita:
SELECT mdl_user.username
from mdl_user, mdl_role, mdl_role_assignments
where
mdl_role.id = mdl_role_assignments.roleid AND
mdl_role_assignments.userid=mdl_user.id and
mdl_role.id=5 and
mdl_user.username not like '%prueba%'
order by mdl_user.username
from mdl_user, mdl_role, mdl_role_assignments
where
mdl_role.id = mdl_role_assignments.roleid AND
mdl_role_assignments.userid=mdl_user.id and
mdl_role.id=5 and
mdl_user.username not like '%prueba%'
order by mdl_user.username