Skip to content

Instantly share code, notes, and snippets.

@theWill
Created October 21, 2014 22:38
Show Gist options
  • Save theWill/33eaee6113d1c9a89cc9 to your computer and use it in GitHub Desktop.
Save theWill/33eaee6113d1c9a89cc9 to your computer and use it in GitHub Desktop.
get_member_marathon_statistics_history
SELECT
rr.round_id AS challenge_id
, r.short_name AS challenge_name
, to_char(cal.date, '%Y.%m.%d') AS date
, NVL(rr.new_rating, rr.old_rating) AS rating
, crh.rank AS placement
, TRIM(NVL(crh.percentile, 'N/A')) AS percentile
FROM round r
, calendar cal
, long_comp_result rr
, coder c
, coder_rank_history crh
WHERE r.round_id = rr.round_id
AND rr.coder_id = c.coder_id
AND cal.calendar_id = r.calendar_id
AND r.round_type_id IN (13,15,19)
AND handle_lower = LOWER('@handle@')
AND rr.round_id = crh.round_id
AND rr.coder_id = crh.coder_id
AND crh.coder_rank_type_id = 2
AND crh.algo_rating_type_id = 3
AND rr.rated_ind = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment