SELECT c.id, c.shortname, g.assignment, a.name, u.username, g.grade
FROM prefix_assign_grades AS g
JOIN prefix_user AS u ON g.userid = u.id
JOIN prefix_assign AS a ON g.assignment = a.id
JOIN prefix_course AS c ON a.course = c.id
WHERE c.id = ## AND u.id = ##
Showing rows 0 - 29 ( 16,818 total, Query took 0.0011 sec)
SELECT u.id, u.picture, u.firstname, u.lastname, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.imagealt, u.email, u.id AS userid, s.status AS
STATUS , s.id AS submissionid, s.timecreated AS firstsubmission, s.timemodified AS timesubmitted, s.attemptnumber AS attemptnumber, g.id AS gradeid, g.grade ASgrade, g.timemodified AS timemarked, g.timecreated AS firstmarked, uf.mailed AS mailed, uf.locked AS locked, uf.extensionduedate AS extensionduedate,uf.workflowstate AS workflowstate, uf.allocatedmarker AS allocatedmarker
FROM mdl_user u
LEFT JOIN mdl_assign_submission s ON u.id = s.userid
AND s.latest =1
LEFT JOIN mdl_assign_grades g ON u.id = g.userid
AND g.attemptnumber = s.attemptnumber
LEFT JOIN mdl_assign_user_flags uf ON u.id = uf.userid
LIMIT 0 , 30
沒有留言:
張貼留言