select top 100 posts.OwnerUserId, users.DisplayName, coun...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Language Learning

Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition

select top 100 posts.OwnerUserId, users.DisplayName,
count(*) as total_posts,
SUM(CASE WHEN posttypes.name='Answer' THEN 1 ELSE 0 END) as total_answers,
SUM(CASE WHEN posttypes.name='Question' THEN 1 ELSE 0 END) as total_questions
from posts
left join posttypes on posts.PostTypeId = posttypes.Id
left join users on posts.OwnerUserId = users.id
group by posts.OwnerUserId, users.DisplayName
having 
SUM(CASE WHEN posttypes.name='Answer' THEN 1 ELSE 0 END) >= 1 and 
SUM(CASE WHEN posttypes.name='Question' THEN 1 ELSE 0 END) >= 1
order by total_posts desc
;

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results