Q&A for people studying math at any level and professionals in related fields
select posts.body , users.reputation into #posts from Users inner join posts on posts.owneruserid = users.id WHERE Users.Reputation < 100 and posttypeid = 2 select choose( case when Reputation < 15 then 1 when reputation between 15 and 50 then 2 else 3 end, 'None', 'FlagOnly', 'FlagAndComment') AS Privilege, Count(*) [PrivilegeCount] from #posts where body like '%stackoverflow%' and (body like '%http:%' or body like '%https:%') group by case when Reputation < 15 then 1 when reputation between 15 and 50 then 2 else 3 end