Editor, Strunk & White, Copy Editor


Please login or register to vote for this query.

(click on this box to dismiss)

Genealogy and Family History Meta

Q&A about the site for expert genealogists and people interested in genealogy or family history

-- Editor, Strunk & White, Copy Editor

;with Requirements(Description, Requirement) as
    select 'Editor'        ,   1 union all
    select 'Strunk & White',  80 union all
    select 'Copy Editor'   , 500
select [User Link]   = ##UserId##,
       [Edits]       = c.countRevisions,
       [Badge]       = r.description,
       [Requirement] = r.Requirement,
       [To Go]       = (select max(ToGo) from (values
                         (r.Requirement - countRevisions),
                         (0)) [ ] (ToGo))
    select count(DISTINCT ph.RevisionGUID) as countRevisions
    from PostHistory ph
    where ph.PostHistoryTypeId in (4,5) -- check in PostHistoryTypes for these magic numbers
      and ph.UserId = ##UserId##
      and not exists (select * from Posts p       
                      where p.OwnerUserId = ph.UserId and p.Id = ph.PostId)
) c
inner loop join Requirements r on 1=1
order by r.Requirement desc

Enter Parameters

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