;with Data as ( select p.Id, case when p.Tags like '%stat...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Meta Stack Overflow

Q&A about the site for professional and enthusiast programmers

;with Data as
(
  select 
    p.Id,
    case 
      when p.Tags like '%status-completed%' then 'Completed'
      else 'Not Completed'
      end [Status]
  from Posts p
  where 
    p.PostTypeId = 1 and
    p.Tags like '%burninate-request%'
)
select
  d.Status,
  count(d.Id) [Post Count],
  (count(d.Id) * 1.0) / (select count(1) from Data) * 100 [Percent]
from Data d
group by d.Status

Enter Parameters

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