select COUNT(Name) from Badges b join Users u on u....

0

Please login or register to vote for this query.

(click on this box to dismiss)

Signal Processing Meta

Q&A about the site for practitioners of the art and science of signal, image and video processing

--declare @BadgeCount int = sum(select COUNT(Id) from Badges where Name = 'Enlightened')
--select Distinct TOP 1 u.AccountId, u.Reputation, u.DisplayName, u.Location from Users u
--JOIN Badges b 
--ON u.AccountId = b.UserId
--where u.Location like '%South Africa' 
--And b.Id = @BadgeCount
--And b.Date >= '2016-01-01' and b.Date <= '2016-12-31'
--group by u.DisplayName
--order by u.Reputation desc

--select DISTINCT u.Id, u.Reputation, u.DisplayName, u.Location from Users u
--JOIN Badges b 
--ON u.AccountId = b.UserId
--where u.Location like '%South Africa' 
--And b.Name = 'Enlightened'
--And year(b.Date) = 2016
--order by u.Reputation desc

--select u.displayname, sum(case when b.name = 'Enlightened' then 1 else 0 end)
--from users u
--join badges b on u.accountid=b.userid
--where u.reputation = (select max(reputation) from users where location = 'south africa')
--and u.location = 'south africa'
--and year(b.date) = 2016
--group by displayname

--What is the name of the most reputable "South Africa" user 
--and how many "Enlightened" badges did they receive in 2016?

--select TOP 1 * from Users where Location like '%South Africa'
--order by Reputation Desc

--select * from Badges where Name = 'Enlightened' and year(Date) = 2016

select COUNT(Name) from Badges b
join Users u 
on u.AccountId = b.UserId
where b.Name = 'Enlightened' and year(b.Date) = 2016

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results