daily pastebin goal
64%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. SELECT hs.*,AVG(hsm.Mark)
  3. FROM H_Students hs
  4. LEFT JOIN H_Students st_later
  5. ON st_later.UID > hs.UID AND
  6. st_later.Id = hs.Id
  7. LEFT JOIN H_StudentMarks hsm
  8. ON hsm.StudentId = hs.Id
  9. LEFT JOIN H_StudentMarks sm_later
  10. ON sm_later.UID > hsm.UID AND
  11. sm_later.StudentId = hsm.StudentId AND
  12. sm_later.SubjectID = hsm.SubjectId AND
  13. sm_later.ExamDate = hsm.ExamDate
  14. WHERE st_later.UID IS NULL AND
  15. hs.EventType <> 'D' AND
  16. sm_later.UID IS NULL AND
  17. (hsm.EventType <> 'D' OR hsm.UID IS NULL)
  18. GROUP BY hs.Id,hs.UID
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top