https://meta.stackoverflow.com/q/316413
Q&A about the site for professional robotic engineers, hobbyists, researchers and students
select u.DisplayName ,sum( case when posttypeid = 1 then 1 else null end) [Questions] ,sum( case when posttypeid = 2 then 1 else null end) [Answers] ,sum( case when posttypeid in (1,2) then 1 else null end) [Total] from posts p inner join posttags pt on pt.postid = coalesce(p.parentid, p.id) inner join tags t on t.id = pt.tagid inner join Users u on p.OwnerUserId = u.Id where t.TagName = 'machine-learning'and ( lower(u.Location) like '%saudi%' or lower(u.Location) like '%saudi arabia%' ) group by u.DisplayName