Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.66 KB | None | 0 0
  1. SELECT  COUNT(result_answerid) AS MAX,(SUM(result_answer_iscorrect)/2) AS score FROM (SELECT * FROM ph_results_answers WHERE questionid IN (SELECT questionid FROM ph_tests_questions WHERE testid=28) AND resultid=250 ) a  INNER JOIN ph_questions b ON a.questionid = b.questionid WHERE question_diff = 3
  2.  
  3. UNION ALL
  4.  
  5. SELECT  COUNT(result_answerid) AS ABC ,(SUM(result_answer_iscorrect)/2) AS CDE FROM (SELECT * FROM ph_results_answers WHERE questionid IN (SELECT questionid FROM ph_tests_questions WHERE testid=28) AND resultid=250 ) a  INNER JOIN ph_questions b ON a.questionid = b.questionid WHERE question_diff = 2 OR  question_diff = 1
  6.  
  7. MAX score
  8. 1   1.0000
  9. 3   2.0000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement