Skip to content

Instantly share code, notes, and snippets.

@mamontov-cpp
Created April 7, 2014 19:01
Show Gist options
  • Save mamontov-cpp/10031005 to your computer and use it in GitHub Desktop.
Save mamontov-cpp/10031005 to your computer and use it in GitHub Desktop.
SELECT
`qa`.id as id,
utg.`grade` as grade,
`qa`.`rightanswer` as correctanswer,
`qa`.`responsesummary` as `comparedanswer`
FROM
`quiz_attempts` qua,
`quiz`,
`user` u,
`usernames_to_grades` utg,
`question_attempts` qa
WHERE
qua.quiz = `quiz`.id
AND qua.`userid` NOT IN (456, 261, 3992, 5192, 5214, 5276, 3988, 5186, 5307, 5229)
AND u.id = qua.`userid`
AND utg.firstname = LOWER(u.firstname)
AND utg.lastname = LOWER(u.lastname)
AND `quiz`.`name` LIKE '%Correct%';
AND qa.questionusageid = qua.uniqueid,
AND qa.responsesummary != ""
LIMIT 0, 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment