FRC Tracker 2018

App Store Badge

2019 Championship Ranking

Central New York Regional Teams at the 2019 Championship

The table below shows the teams from the regional competition ordered by ranking score.

SQL query failed: [ERROR:  relation "match_2019" does not exist
LINE 37:    match_2019 AS match,
            ^] SELECT
 row_number() OVER (ORDER BY sq1.rp_sum::float/sq1.cmatch DESC,sq1.pts_auto_sum::float/sq1.cmatch DESC,event_team.team_number) as rank,
 '' || regexp_replace(sq1.name_event, '^CMP ', '') || '' AS name_event,
 event_team.team_number,
 team.name AS team_name,
 sq1.cmatch,
 sq1.rp_sum,
 sq1.pts_auto_sum,
 to_char(sq1.rp_sum::float/sq1.cmatch, '0.99') AS rp_avg,
 to_char(sq1.pts_auto_sum::float/sq1.cmatch, '90.0') AS pts_auto_avg
FROM event_team,team,
 (SELECT
   event_team.team_number AS num_team
  FROM
   event,event_team
  WHERE
   event.year=2019
   AND event.code='NYUT'
   AND event_team.id_event=event.id
 ) AS sq_home,
 (SELECT
   event.id AS id_event,
   event.code AS code_event,
   event.name AS name_event,
   match_team.num_team,
   COUNT(match.*) AS cmatch,
   SUM(CASE
       WHEN match_team.dq != 0 THEN 0
       WHEN match_team.position <= 3 THEN (CASE WHEN match.score_red > match.score_blue THEN 2 ELSE 0 END)
       ELSE (CASE WHEN match.score_blue > match.score_red THEN 2 ELSE 0 END)
   END)
   + SUM(CASE WHEN match_team.dq != 0 THEN 0 WHEN match.score_red = match.score_blue THEN 1 ELSE 0 END)
   + SUM(CASE WHEN match_team.dq != 0 THEN 0 WHEN match_team.position <= 3 THEN match.rp_red ELSE match.rp_blue END) AS rp_sum,
   SUM(CASE WHEN match_team.position <= 3 THEN match.pts_auto_red ELSE match.pts_auto_blue END) AS pts_auto_sum
  FROM
   event,
   match_2019 AS match,
   match_team_2019 AS match_team
  WHERE
   event.year=2019
   AND event.type = 55
   AND match.id_event = event.id
   AND match.score_red != -1
   AND match_team.id_match = match.id
   AND match_team.surrogate = 0
  GROUP BY
   event.id,
   match_team.num_team
 ) AS sq1
WHERE
 event_team.id_event=sq1.id_event
 AND event_team.team_number=sq1.num_team
 AND team.year=2019
 AND team.number=sq1.num_team
 AND team.number=sq_home.num_team
ORDER BY
 sq1.rp_sum::float/sq1.cmatch DESC,
 sq1.pts_auto_sum::float/sq1.cmatch DESC,
 event_team.team_number

© 2009-2018, Idle Loop Software Design, LLC