Skip to content

Instantly share code, notes, and snippets.

@RaghuDMT
Last active May 23, 2017 06:28
Show Gist options
  • Save RaghuDMT/d4bad430249a6ab3538811da65708739 to your computer and use it in GitHub Desktop.
Save RaghuDMT/d4bad430249a6ab3538811da65708739 to your computer and use it in GitHub Desktop.
select f.Country_Name ,e.Season_Year,sum([Runs_Scored]) as [Runs Scored]
from [dbo].[Ball_by_Ball] a
inner join [dbo].[Batsman_Scored] b
on concat(a.Match_Id,a.Over_Id,a.Ball_Id,a.Innings_No)=
concat(b.[Match_Id],b.Over_Id,b.Ball_Id,b.Innings_No)
inner join Player c on a.Striker=c.Player_Id
inner join Match d on a.Match_Id=d.Match_Id
inner join Season e on d.Season_Id=e.Season_Id
inner join Country f on f.Country_Id=c.Country_Name
where e.Season_Year=2016
group by f.Country_Name,e.Season_Year
order by 3 desc
@RaghuDMT
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment