Hosted on SourceForge
and licensed under
Creative Commons GNU GPL.
| Chris Hartjes submitted this query on: April 04, 2008 2:20pm EDT | |
| TITLE | Get current pitcher for a baseball event |
|---|---|
| SPORTS | Baseball |
| QUERY | SELECT baseball_event_states.inning_half, display_names.full_name FROM baseball_event_states, events, display_names WHERE events.event_key = 'l.mlb.com-2008-e.23400' AND baseball_event_states.event_id = events.id AND baseball_event_states.current_state = 1 AND display_names.entity_id = baseball_event_states.pitcher_id AND display_names.entity_type = 'persons' |
| DESCRIPTION | If you know the event key for a game in progress, you can get the pitcher by looking for matches in the baseball_event_states table based on event key and current state, where a value of 1 indicates you want the most recent event |
| DBs TESTED | MySQL |
| ADDITIONAL NOTES | |