Skip to content

Instantly share code, notes, and snippets.

@RaghuDMT
Created May 23, 2017 11:31
Show Gist options
  • Save RaghuDMT/f4ed01fbfe000a689e318e557ea210a8 to your computer and use it in GitHub Desktop.
Save RaghuDMT/f4ed01fbfe000a689e318e557ea210a8 to your computer and use it in GitHub Desktop.
select v.Venue_Name, sum(case when([Runs_Scored]=6) then 1 else 0 end) Sixes,count(distinct m.Match_Id) Matches,sum(case when([Runs_Scored]=6) then 1 else 0 end)/count(distinct m.Match_Id) Sixes_Per_Match
from [dbo].[Batsman_Scored] b
inner join Match m on b.Match_Id=m.Match_Id
inner join Venue v on v.Venue_Id=m.Venue_Id
group by v.Venue_Name
order by 2 desc
@RaghuDMT
Copy link
Author

image

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