Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1.  
  2. SELECT dnt.full_name AS team_name, dnt.abbreviation as team_name_short, dn.first_name, dn.last_name, p.person_key, p.birth_date, pp.phase_status, pp.uniform_number, pp.regular_position_id, pp.regular_position_depth, pp.height, pp.weight, pp.duration AS years, pos.abbreviation as position_name, t.id as team_id, t.team_key, l.city as birth_city, l.state as birth_state, l.country as birth_country FROM persons p JOIN person_phases AS pp ON (p.id = pp.person_id) JOIN teams AS t ON (pp.membership_id = t.id) JOIN display_names AS dn ON (dn.entity_id = p.id AND dn.entity_type='persons') JOIN display_names AS dnt ON (dnt.entity_id = t.id AND dnt.entity_type='teams') JOIN positions AS pos ON (pos.id = pp.regular_position_id) JOIN publishers AS pub ON (pub.id = p.publisher_id AND pub.publisher_key = 'stats.com') LEFT JOIN locations l ON l.id = p.birth_location_id WHERE pp.membership_type = 'teams' AND dnt.full_name != 'Atlantic' AND dnt.full_name != 'Central' AND dnt.full_name != 'Pacific' AND dnt.full_name != 'Metropolitan' AND dnt.full_name NOT LIKE '%Team%' AND pp.phase_status IN ('active','injured', 'suspended') AND p.person_key LIKE '%nhl%' AND dnt.abbreviation = 'STL' ORDER BY dn.last_name ASC, dn.first_name ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement