Skip to content

Instantly share code, notes, and snippets.

@RaghuDMT
Created May 23, 2017 05:43
Show Gist options
  • Save RaghuDMT/c1e85bf4290b19b3286929dc4b277748 to your computer and use it in GitHub Desktop.
Save RaghuDMT/c1e85bf4290b19b3286929dc4b277748 to your computer and use it in GitHub Desktop.
select a.Match_Id,c.Player_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
group by a.Match_Id,c.Player_Name,e.Season_Year
order by 4 desc
@RaghuDMT
Copy link
Author

image

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