Q&A for programming puzzle enthusiasts and code golfers
In the UserId box below, enter:
* your user id, to see your stats
* null, to see the stats of all users
declare @UserId int = ##UserId##;
with EndIndex as (
p.Id, p.ParentId as QuestionId, p.Body,
replace(replace(replace(replace(p.Body, ' ', '|'), '<', '|'), ':', '|'), ',', '|')
, 5) as LanguageNameEndIndex
join Posts q
on p.ParentId = q.Id
p.PostTypeId = 2 --answer
and p.Body like '<h[1-3]>%'
and q.Tags not like '%king-of-the-hill%'
and (p.OwnerUserId = @UserId or @UserId is null)
), AnswerLanguages as (
Id, QuestionId, Body,
'http://codegolf.stackexchange.com/a/' + convert(varchar(99), Id) as Link,
lower(substring(Body, 5, LanguageNameEndIndex-5)) as Language
--select * from AnswerLanguages where Language like 'tsql%'
select Language, count(1) as AnswerCount
group by Language
order by count(1) desc