selimppc

test sql query

Jul 13th, 2015
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. SELECT
  2. a.user_id AS ID,
  3. a.first_name AS first_name,
  4. a.last_name AS last_name,
  5. AVG(b.correct) AS average_correct,
  6. MAX(b.taken_time) AS taken_time
  7. FROM `user` a
  8. LEFT JOIN test_result b ON a.user_id = b.user_id
  9. GROUP BY a.user_id ORDER BY a.user_id ASC
Advertisement
Add Comment
Please, Sign In to add comment