Holiday Work Horse

1

Please login or register to vote for this query.

(click on this box to dismiss)

Who's asking/answering the most questions on U.S. holidays?! (And why? ... just kidding, we know why...)

Meta Stack Exchange

Q&A for meta-discussion of the Stack Exchange family of Q&A websites

-- Holiday Work Horse
-- Who's asking/answering/commenting the most
-- on typical U.S. holidays?! And why? (just kidding)
SELECT
    u.DisplayName        as 'User Name'
    ,count(p.Title)+count(c.Id)      as 'Number of Questions/Answers/Comments'
   
   ,(u.Reputation/(count(p.title)+count(c.Id)))     as 'Reputation'
   --,count(p.Id)         as 'Total Posts'
   --,p.Title             as 'Title'
   --,p.CreationDate      as 'Date'
   -- ,c.Text
   --,(count(p.Id) + count(c.Id)) as 'Total comments/posts'
  
FROM
  users u
    INNER JOIN posts p    on p.OwnerUserId = u.id
    INNER JOIN comments c on c.UserId      = u.id

WHERE
  1=1
  AND (p.PostTypeId IN (1,2))
  AND p.OwnerUserId IS NOT NULL
  AND u.Reputation > 250
  -- AND u.DisplayName = 'iight'
  -- AND (p.CreationDate < '2012-11-29' AND p.CreationDate > '2012-11-27')
  AND
  (
    (Month(p.CreationDate) = 12 AND Day(p.CreationDate) = 25)
     OR
    (Month(p.CreationDate) = 7 AND Day(p.CreationDate) = 4)
  )

GROUP BY
  u.DisplayName,u.Reputation
ORDER BY
--  p.CreationDate DESC
  'Number of Questions/Answers/Comments' DESC

Enter Parameters

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