Query Library

Casey Trauer submitted this query on: September 27, 2010 6:58pm EDT
TITLE Find all news stories and abstract for a given team
SPORTS ALL SPORTS, Ice Hockey
QUERY SELECT doc.doc_id, doc.date_time, doc.title, dc.abstract_blob, t.team_key, dn.full_name
FROM documents doc
JOIN document_contents dc ON dc.document_id = doc.id
JOIN document_fixtures df ON doc.document_fixture_id = df.id
JOIN teams_documents td ON td.document_id = doc.id
JOIN teams t ON td.team_id = t.id
JOIN display_names dn ON (dn.entity_type = 'teams' and dn.entity_id = t.id)
WHERE df.fixture_key = 'general-news'
AND t.team_key = 'l.nhl.com-t.8'
GROUP BY doc.revision_id
ORDER BY doc.date_time DESC;
DESCRIPTION Returns all news headlines and abstracts related to a given team.kj
DBs TESTED MySQL
ADDITIONAL NOTES