daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Feb 17th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT
  2.     r0.sims_id,
  3.     r0.subject,
  4.     r1.result AS "C1",
  5.     r2.result AS "C2",
  6.     r3.result AS "C3"
  7. FROM
  8.     (SELECT DISTINCT
  9.         sims_id, subject
  10.      FROM
  11.          results
  12.      ) r0
  13.     LEFT JOIN results r1
  14.         ON r1.sims_id = r0.sims_id AND r1.subject = r0.subject AND r1.progress_check = 'C1'
  15.     LEFT JOIN results r2
  16.         ON r2.sims_id = r0.sims_id AND r2.subject = r0.subject AND r2.progress_check = 'C2'
  17.     LEFT JOIN results r3
  18.         ON r3.sims_id = r0.sims_id AND r3.subject = r0.subject AND r3.progress_check = 'C3'
  19. ORDER BY
  20.     r0.sims_id, r0.subject ;
RAW Paste Data
Top