Hosted on SourceForge
and licensed under
Creative Commons GNU GPL.
| Alan Karben submitted this query on: February 07, 2008 1:08am EST | |
| TITLE | Get event-keys for all games today in a league |
|---|---|
| SPORTS | ALL SPORTS |
| QUERY | SELECT events.event_key, events.start_date_time FROM events, affiliations, affiliations_events WHERE affiliations_events.affiliation_id = affiliations.id AND affiliations_events.event_id = events.id AND affiliations.affiliation_key = 'l.mlb.com' AND events.start_date_time > '2007-08-04' AND events.start_date_time < '2007-08-05' |
| DESCRIPTION | gets event-keys |
| DBs TESTED | MySQL |
| ADDITIONAL NOTES | |
"This query tweaks the original query a bit in that it returns only games where a National League team is the home team. You can change the a2.affiliation_key value to c.american to get AL-hosted games.
Also, the time query uses a time, acknowledging that values in the DB are GMT offset, so it will return games that have a value of 2009-08-07 in the DB but actually start 2009-08-06 local time. This is just one way to account for GMT offset."