tag edit history on questions with 5 or more tags being edited


Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

create table #hist(id int, postid int, tagcount int)

CREATE CLUSTERED INDEX #idx_hist ON #hist (id, postid);

insert into #hist
  select id
     -- , LEN(text) - LEN(REPLACE(text, '<', '')) [cnt]
      , (select count(*) - 1 from string_split(text, '<')) [tagcount]
  from posthistory 
  where posthistorytypeid = 3
  or  posthistorytypeid = 6

select count(distinct postid) [questions tag 5]
from (
  select postid
  from #hist
  where tagcount > 4
  group by postid
  having count(*) > 2
) data

select count(*) from string_split('<test>', '<')

Enter Parameters

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