Flink questions per week

0

Please login or register to vote for this query.

(click on this box to dismiss)

Philosophy Meta

Q&A about the site for those interested in the study of the fundamental nature of knowledge, reality, and existence

DECLARE @tag0 nvarchar(25) = ##tag0:string?apache-flink##
DECLARE @tag1 nvarchar(25) = ##tag1:string?flink-streaming##
DECLARE @tag2 nvarchar(25) = ##tag2:string?flink-statefun##
DECLARE @weeks int         = ##weeks:int?52##
DECLARE @aSunday DATE = '2000-01-02'

SELECT
  dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday) week,
  t.TagName,
  count(*)
FROM PostTags pt
JOIN Posts q ON q.Id=pt.PostId
JOIN Tags t ON t.Id=pt.TagId
WHERE
  TagName IN (@tag0, @tag1, @tag2) AND
  q.CreationDate < dateadd(week, datediff(week, @aSunday, getdate()), @aSunday) AND
  q.creationdate between Dateadd(ww, -@weeks, getdate()) AND Dateadd(ww, -1, getdate())
GROUP BY dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday), TagName
ORDER BY dateadd(week, datediff(week, @aSunday, q.CreationDate), @aSunday)

Enter Parameters

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