Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. SELECT dnt.full_name AS team_name_full, dnt.abbreviation as team_name_short, dnt.abbreviation as team_abbreviation, dnt.first_name AS team_city, dnt.last_name as team_name, 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, pmtd.metadata_value as stick_hand, pos.abbreviation as position_name, t.id as team_id, t.team_key, l.city as birth_city, l.state as birth_state, l.area as birth_area, l.country as birth_country FROM persons p JOIN person_phases AS pp ON (p.id = pp.person_id) LEFT JOIN person_sport_metadata AS pmtd ON (p.id = pmtd.person_id) LEFT 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') LEFT 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 = 'leaguestat.com') LEFT JOIN locations l ON l.id = p.hometown_location_id WHERE pp.membership_type = 'teams' AND pp.phase_status IN ('active','injured', 'suspended') AND p.person_key = 'l.qmjhl.ca-p.14631' 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%' ORDER BY dn.last_name ASC, dn.first_name ASC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement