Query Library

Casey Trauer submitted this query on: October 29, 2009 1:32pm EDT
TITLE Get season passing/receiving stats for one player
SPORTS American Football
QUERY SELECT dn.first_name, dn.last_name, p.person_key, dn_team.full_name, afps.*
FROM stats s
JOIN american_football_passing_stats afps ON afps.id = s.stat_repository_id 
JOIN persons p ON p.id = s.stat_holder_id 
JOIN display_names dn ON p.id = dn.entity_id
JOIN display_names dn_team ON s.stat_membership_id = dn_team.entity_id
JOIN sub_seasons ss ON ss.id = s.stat_coverage_id

WHERE s.stat_repository_type = 'american_football_passing_stats'
AND s.stat_holder_type = 'persons'
AND dn.entity_type = 'persons'
AND dn_team.entity_type = 'teams'
AND s.stat_coverage_type = 'sub_seasons'
AND ss.sub_season_key = '2009_season_regular' 
AND p.person_key = 'l.nfl.com-p.4935'
DESCRIPTION Returns season stats from the american_football_passing_stats table for a given player.
DBs TESTED MySQL
ADDITIONAL NOTES This particular query is for Braylon Edwards who was traded mid-season in 2009. It should return a row for each team.
Your log.directory config setting does not point to a writable directory.