Hosted on SourceForge
and licensed under
Creative Commons GNU GPL.
| Casey Trauer submitted this query on: August 12, 2009 10:55am EDT | |
| TITLE | Get offensive baseball stats for one player for one game |
|---|---|
| SPORTS | Baseball |
| QUERY | SELECT dn_player.first_name, dn_player.last_name, p.person_key, dn_team.full_name, t.team_key, off.* FROM stats s JOIN baseball_offensive_stats off ON s.stat_repository_id = off.id JOIN teams t ON s.stat_membership_id = t.id JOIN persons p ON s.stat_holder_id = p.id JOIN events e ON s.stat_coverage_id = e.id JOIN display_names dn_player ON s.stat_holder_id = dn_player.entity_id JOIN display_names dn_team ON s.stat_membership_id = dn_team.entity_id WHERE s.stat_holder_type = 'persons' AND s.stat_coverage_type = 'events' AND s.stat_repository_type = 'baseball_offensive_stats' AND dn_player.entity_type = 'persons' AND dn_team.entity_type = 'teams' AND e.event_key = 'l.mlb.com-2009-e.26017' AND p.person_key = 'l.mlb.com-p.4406' AND s.context = 'event'; |
| DESCRIPTION | Returns offensive baseball stats for one player for one game. |
| DBs TESTED | MySQL |
| ADDITIONAL NOTES | For in-game boxes, you must change the s.context value to 'event-play'. |