StackOverflow posts-per-year by location

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

select
*

from (
  select
  U.Location,
  year(P.CreationDate) [Year Posted],
  count(P.Id) [Total Posts]

  from Posts P
  join Users U on U.Id = P.OwnerUserId
  
  where
  U.Location in ('South Africa', 'Nigeria', 'Kenya')
  
  group by
  U.Location,
  year(P.CreationDate)
  
) T0

pivot (
  sum([Total Posts])
  for [Year Posted]
  in (
    [2008],
    [2009],
    [2010],
    [2011],
    [2012],
    [2013],
    [2014],
    [2015],
    [2016],
    [2017],
    [2018]
  )
) P

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results