Most frequent tag creators

0

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフローMeta

プログラマーと熱狂的なプログラマーのためのサイトに関する質問と回答

---the query looks at the first revisiont with the given tag
---mostly that could correspond to tag creator
---in some cases the post where the tag was created might have been deleted
; with tagshistory_cte AS
(
SELECT
  Id AS phid,
  replace(value,'>','') TagName
FROM
  PostHistory
  CROSS APPLY STRING_SPLIT(Text,'<')
Where PostHistoryTypeId in (3,6,9)
and len(value) > 0
), tagsfirst_cte AS (
SELECT
  tagname,
  MIN(phid) AS firstid
FROM tagshistory_cte
GROUP BY tagname
)

SELECT
  t.tagname,
  ph.UserId
FROM tagsfirst_cte t INNER JOIN PostHistory ph ON ph.id=t.firstid
WHERE ph.UserId = 3671

Enter Parameters

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