Query Library

Keith Levi Lumanog submitted this query on: March 20, 2012 10:18am EDT
TITLE Get NBA Team Season Stats
SPORTS Basketball
QUERY SELECT dc.sportsml

          FROM teams
          JOIN teams_documents td ON td.team_id = teams.id
          JOIN documents d ON d.id = td.document_id
          JOIN document_contents dc ON dc.document_id = d.id
          where team_key = '{$team_key}' and teams.publisher_id = 1
          and d.document_fixture_id = 25
          ORDER BY d.date_time DESC limit 1
DESCRIPTION d.document_fixture_id = 25 // means season-stats , you change this to post season, pre season. Check document_fixtures.


tested only in NBA
DBs TESTED MySQL
ADDITIONAL NOTES
Comments
on June 14, 2012 4:29pm EDT Hao Huang wrote:
Metadata: DB Tested: MySQL
Query:
SELECT dc.sportsml

          FROM teams
          JOIN teams_documents td ON td.team_id = teams.id
          JOIN documents d ON d.id = td.document_id
          JOIN document_contents dc ON dc.document_id = d.id
          where team_key = '{$team_key}' and teams.publisher_id = 1
          and d.document_fixture_id = 25
          ORDER BY d.date_time DESC limit 1

"qqq"

on September 28, 2012 2:00am EDT Mike Brenner wrote:
Metadata: DB Tested: ALL DATABASES
Query:
n/a

"to see a sample of the stats"