SELECT t.tagname ,( case when t.WikiPostId is null and t....

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT
  t.tagname
  ,(
    case when t.WikiPostId is null and t.excerptPostId is null
        then 'No Wiki/NoExcerpt'
    when t.WikiPostId is null 
        then 'No Wiki'
    when t.excerptPostId is null 
        then 'No Excerpt'
    else '???'
      end
   ) as [What is missing]

FROM posts p -- all posts ...
INNER JOIN posttags pt -- with their all tags ...
    ON pt.postid = coalesce(p.parentid, p.id) -- for answers, use the question
INNER JOIN tags t -- find a single tag
    ON t.id = pt.tagid 
WHERE 
  p.owneruserid = ##userid:int?6083675## -- post belongs to a user
  and (t.excerptPostId is null -- where the excerpt foreignkey is null
  or t.WikiPostId is null) -- or the wiki foreignkey is null

Enter Parameters

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