Q&A for people interested in the history and origins of science and mathematics
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