Last active
May 23, 2017 11:49
-
-
Save RaghuDMT/7f69b9f94ecdb3061d6a449b9596e124 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Author
RaghuDMT
commented
May 23, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment