Loading...Loading chart...
1select year(s.start_date) as year
2 , SUM(CASE WHEN mps.goals_scored IS NOT NULL THEN mps.goals_scored ELSE 0 END) as goals_scored
3 , SUM(CASE WHEN mps.goals_assists IS NOT NULL THEN mps.goals_assists ELSE 0 END) as goals_assists
4from @blt.ultimate_soccer_dataset.seasons s
5inner join @blt.ultimate_soccer_dataset.competitions c on (s.competition_id = c.competition_id)
6inner join @blt.ultimate_soccer_dataset.matches m on (m.season_id = s.season_id)
7inner join @blt.ultimate_soccer_dataset.match_player_stats mps on (mps.match_id = m.match_id)
8where slug = 'primeira-liga' and year(s.start_date) BETWEEN 2015 and 2024
9 and m.status = 'Match Finished' and mps.minutes_played is not null
10group by all
11having goals_scored > 0
12order by 1