Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT s.context, e.event_status, e.event_key,p.person_key,mrqs.qualifying_position
- FROM events AS e
- INNER JOIN affiliations_events AS ae ON ae.event_id = e.id
- INNER JOIN affiliations AS a ON a.id = ae.affiliation_id
- INNER JOIN stats AS s ON s.stat_coverage_id = e.id
- INNER JOIN persons AS p ON s.stat_holder_id = p.id
- INNER JOIN motor_racing_qualifying_stats AS mrqs ON s.stat_repository_id = mrqs.id
- INNER JOIN publishers ON publishers.publisher_key='sportsnetwork.com'
- WHERE
- (a.affiliation_key = 'l.nascar.com.1')
- AND (a.publisher_id = publishers.id)
- AND (s.stat_repository_type = 'motor_racing_qualifying_stats')
- AND (s.stat_coverage_type = 'events')
- AND (s.stat_holder_type = 'persons')
- AND (e.start_date_time >= '2009-05-07 06:00:00')
- AND (e.start_date_time < '2009-05-14 05:59:59')
Add Comment
Please, Sign In to add comment