Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. SELECT * from users
  2. join quiz_result qr on users.user_id = qr.user_id
  3. left join quiz_result qr1 on qr1.user_id = qr.user_id and qr.quiz_result < qr1.quiz_result
  4. where qr1.user_id is null and qr.quiz_id = 1;
  5.  
  6.  
  7. select * from users join quiz_result qr on users.user_id = qr.user_id where quiz_id = 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement