Total count of views/day of i-Questions

1

Please login or register to vote for this query.

(click on this box to dismiss)

Drupal Answers

Q&A for Drupal developers and administrators

DECLARE @now DATETIME = (SELECT MAX(CreationDate) FROM Posts);

PRINT 'now: ' + CAST(@now AS VARCHAR(MAX));

SELECT
  COUNT(*) AS Count,
  SUM(86400.0 * ViewCount / DATEDIFF(s, CreationDate, @now)) AS ViewsPerDay
FROM Posts
WHERE
  PostTypeId = 1
  AND
  CreationDate < DATEADD(d, -7, @now)
  AND
  Title LIKE '% i %'

Enter Parameters

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