Anton.Sandbox

1

Please login or register to vote for this query.

(click on this box to dismiss)

Code Golf and Coding Challenges Meta

Q&A about the site for programming puzzle enthusiasts and code golfers

/* How many views per question appears in a given week
For instance, is SE more active during the Christmas–NY season
or the community do something else?
*/

DECLARE @All int = ##All:int?1##
DECLARE @UsedId int = ##UserId:int##
DECLARE @YearsBack int = ##YearsBack:int?1##
DECLARE @Month int = ##Month:int?12##
DECLARE @DayStart int = ##DayStart:int?20##
DECLARE @DayEnd int = ##DayEnd:int?31##

;WITH UsersSample AS
(
  SELECT u.Id
  FROM Users u tablesample(0.01 percent)
  )
  SELECT p.PostTypeId, p.OwnerUserId,
  COUNT(*) as cnt
FROM Posts p
RIGHT OUTER JOIN UsersSample u ON u.Id = p.OwnerUserId
GROUP BY p.OwnerUserId, p.PostTypeId
ORDER BY p.OwnerUserId, p.PostTypeId

Enter Parameters

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