Hosted on SourceForge
and licensed under
Creative Commons GNU GPL.
| Casey Trauer submitted this query on: July 21, 2009 10:16pm EDT | |
| TITLE | Get roster for one team |
|---|---|
| SPORTS | American Football, Baseball, Basketball, Ice Hockey |
| QUERY | SELECT dn.first_name, dn.last_name, p.person_key, pp.phase_status, pos.abbreviation, pp.uniform_number, pp.regular_position_depth, pp.height, pp.weight FROM persons p JOIN person_phases pp ON p.id = pp.person_id JOIN teams t ON pp.membership_id = t.id JOIN display_names dn ON dn.entity_id = p.id JOIN positions pos ON pos.id = pp.regular_position_id JOIN publishers pub ON pub.id = p.publisher_id WHERE pp.membership_type = 'teams' AND pp.phase_status = 'active' OR pp.phase_status = 'injured' AND dn.entity_type = 'persons' AND pub.publisher_key = 'sportsnetwork.com' AND t.team_key = 'l.mlb.com-t.11' |
| DESCRIPTION | Returns a roster list for one team. |
| DBs TESTED | MySQL |
| ADDITIONAL NOTES | |
"CORRECTION: The originally posted query will return too many rows because of improper implementation of AND/OR statements in the WHERE clause. This query will correct that."
"Slightly reworked to add team name"