Query Library

Casey Trauer submitted this query on: January 26, 2011 4:04pm EST
TITLE Motor racing season points/money leaders
SPORTS Motor Racing
QUERY SELECT dn.full_name, p.person_key, core_stats.events_started, core_stats.events_played, mrrs.points, mrrs.laps_completed, mrrs.laps_leading_total, mrrs.money, mrrs.wins, mrrs.finishes_top_5, mrrs.finishes_top_10, mrrs.non_finishes 
FROM sub_seasons ss
JOIN stats ON (ss.id = stats.stat_coverage_id AND stats.stat_coverage_type = 'sub_seasons' AND stats.stat_repository_type = 'motor_racing_race_stats')
JOIN motor_racing_race_stats mrrs ON stats.stat_repository_id = mrrs.id
JOIN stats AS stats2 ON (ss.id = stats2.stat_coverage_id AND stats2.stat_coverage_type = 'sub_seasons' AND stats2.stat_repository_type = 'core_stats')
JOIN core_stats ON stats.stat_repository_id = core_stats.id
JOIN display_names dn ON stats.stat_holder_id = dn.entity_id
JOIN persons p ON stats.stat_holder_id = p.id
WHERE ss.sub_season_key = '2010_season_regular'
AND dn.entity_type = 'persons'
AND stats.stat_holder_id = stats2.stat_holder_id
ORDER BY mrrs.points + 1 DESC;
DESCRIPTION Contains season statistical information published by the Sports Network.
DBs TESTED MySQL
ADDITIONAL NOTES
Comments
on April 16, 2014 7:13am EDT prashant wrote:
Metadata: DB Tested: MySQL
Query:
n/a

"gg"