Skip to content

Instantly share code, notes, and snippets.

@RaghuS007
Last active May 23, 2017 11:49
Show Gist options
  • Select an option

  • Save RaghuS007/7f69b9f94ecdb3061d6a449b9596e124 to your computer and use it in GitHub Desktop.

Select an option

Save RaghuS007/7f69b9f94ecdb3061d6a449b9596e124 to your computer and use it in GitHub Desktop.
select v.Venue_Name,
sum(case when([Runs_Scored]=4) then 1 else 0 end) Fours,
count(distinct m.Match_Id) Matches,
sum(case when([Runs_Scored]=4) then 1 else 0 end)/count(distinct m.Match_Id) Fours_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
@RaghuS007
Copy link
Copy Markdown
Author

RaghuS007 commented May 23, 2017

image

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