How the expected score of the answers decrease with time

1

Please login or register to vote for this query.

(click on this box to dismiss)

Christianity

Q&A for committed Christians, experts in Christianity and those interested in learning more

WITH Raw AS (
  SELECT
    A.Id,
    A.Score,
    DATEDIFF(s, Q.CreationDate, A.CreationDate) AS Seconds
  FROM Posts Q, Posts A
  WHERE
    A.ParentId = Q.Id
    AND
    A.CreationDate > Q.CreationDate
    AND
    Q.OwnerUserId != A.OwnerUserId
    AND
    Q.Id NOT IN (
      SELECT PostId
      FROM PostHistory
      WHERE PostHistoryTypeId = 18
    )
),
Raw2 AS (
  SELECT
    Id,
    Score,
    Seconds
  FROM Raw
  WHERE Seconds > 0
),
Raw3 AS (
  SELECT
    Id,
    Score,
    FLOOR(LOG(Seconds)/LOG(##LogBase:float?2##)) AS LogSeconds
  FROM Raw2
),
Raw4 AS (
  SELECT
    LogSeconds,
    PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY Score)
      OVER (PARTITION BY LogSeconds) AS MedianScore
  FROM Raw3
)
SELECT DISTINCT LogSeconds, MedianScore
FROM Raw4
ORDER BY LogSeconds

Enter Parameters

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