TAG BADGES only awarded to ONE USER

1

Please login or register to vote for this query.

(click on this box to dismiss)

Physics

Q&A for active researchers, academics and students of physics

select
  name as [Tag Badge],
  min([Date]) as [Date Awarded],
  userid,
  min(class) as class
into #b from badges
where tagbased='true'
group by name, userid
having count(*)=1

select 
  format([Date Awarded],'yyyy-MMM-d ddd'),
  case class when 1 then 'gold' when 2 then 'silver' else 'bronze' end as [Type],
  [Tag Badge] as TagName,
  t.[count] as [Total Posts in Tag],
  userid as [User Link],
  format(reputation,'#,##0') as Reputation,
  year(u.creationdate) as [Joined],
  Location
from #b b left join users u on b.userid=u.id left join tags t on t.tagname=b.[Tag Badge]
order by class desc, [Date Awarded] desc

Enter Parameters

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