Guest User

Untitled

a guest
Jun 23rd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. SELECT s.context, e.event_status, e.event_key,p.person_key,mrqs.qualifying_position
  2. FROM events AS e
  3. INNER JOIN affiliations_events AS ae ON ae.event_id = e.id
  4. INNER JOIN affiliations AS a ON a.id = ae.affiliation_id
  5. INNER JOIN stats AS s ON s.stat_coverage_id = e.id
  6. INNER JOIN persons AS p ON s.stat_holder_id = p.id
  7. INNER JOIN motor_racing_qualifying_stats AS mrqs ON s.stat_repository_id = mrqs.id
  8. INNER JOIN publishers ON publishers.publisher_key='sportsnetwork.com'
  9. WHERE
  10. (a.affiliation_key = 'l.nascar.com.1')
  11. AND (a.publisher_id = publishers.id)
  12. AND (s.stat_repository_type = 'motor_racing_qualifying_stats')
  13. AND (s.stat_coverage_type = 'events')
  14. AND (s.stat_holder_type = 'persons')
  15. AND (e.start_date_time >= '2009-05-07 06:00:00')
  16. AND (e.start_date_time < '2009-05-14 05:59:59')
Add Comment
Please, Sign In to add comment