Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO fhc_hockey_league_results (schedule_id,result,result_comment)
- SELECT
- sch.schedule_id,
- concat('{ "h":',substr(tmp.score_end,1,locate(':',tmp.score_end)-1)
- ,', "g":',substr(tmp.score_end,locate(':',tmp.score_end)+1)
- ,', "h1":',substr(tmp.score_first,1,locate(':',tmp.score_first)-1)
- ,', "g1":',substr(tmp.score_first,locate(':',tmp.score_first)+1)
- ,', "h2":',substr(tmp.score_second,1,locate(':',tmp.score_second)-1)
- ,', "g2":',substr(tmp.score_second,locate(':',tmp.score_second)+1)
- ,', "h3":',substr(tmp.score_third,1,locate(':',tmp.score_third)-1)
- ,', "g3":',substr(tmp.score_third,locate(':',tmp.score_third)+1)
- ,', "hot":',substr(tmp.score_ot,1,locate(':',tmp.score_ot)-1)
- ,', "got":',substr(tmp.score_ot,locate(':',tmp.score_ot)+1)
- ,', "hp":',substr(tmp.score_pen,1,locate(':',tmp.score_pen)-1)
- ,', "gp":',substr(tmp.score_pen,locate(':',tmp.score_pen)+1),' }'
- ) as result,
- concat(hc.club_name,' - ',ac.club_name) AS result_comment
- FROM fhc_hockey_league_schedule sch
- JOIN fhc_hockey_club_team hct
- ON hct.team_id = sch.home_team_id
- JOIN fhc_hockey_club_team act
- ON act.team_id = sch.away_team_id
- JOIN fhc_hockey_club hc
- ON hc.club_id = hct.club_id
- JOIN fhc_hockey_club ac
- ON ac.club_id = act.club_id
- JOIN tmp_termine tmp
- ON tmp.datum = sch.datum
- AND tmp.zeit = sch.zeit
- AND tmp.home = hc.club_name
- AND tmp.away = ac.club_name
- WHERE tmp.score_end !=""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement