I want to write a query which selects the highest scored community-wiki questions (like this one) but I don't have an idea how to do it. This is what I have so far:


  1. How to do it?
  2. It is also possible to select question which are NOT community-wiki? If yes: how to do it?

UPDATE - info:

Community-wiki posts are slightly different than community-wiki-locked posts - how to deal with it here

  • 3
    AND CommunityOwnedDate is not null
    – rene
    Dec 12, 2019 at 11:02
  • @rene if today you write your comment as answer I will accept it Dec 12, 2019 at 11:21

1 Answer 1


You seem to have adjusted your query already (perhaps after @rene's comment which I failed to spot at first); it is working fine.

There's no IsCommunityWiki boolean/bit column in the Posts table; instead, you have to check the CommunityOwnedDate which is NULL if and only if it's not a community wiki post. So

AND p.CommunityOwnedDate is not null

selects community wiki posts only, and

AND p.CommunityOwnedDate is null

would only select posts which are not community wiki.

  • This question stackoverflow.com/questions/503093/… is strage - it is written on its top "community wiki" however we see its author - and for this question CommunityOwnedDate=null - do you know how to 'select' this kind of questions? Or may be I should write separate question about this? Dec 12, 2019 at 11:39
  • That's not a community wiki question, it's a question with a 'Community Wiki' lock. That's slightly different; it disables edits (on the question) completely, instead of lowering the edit barrier. How to select those should be a separate question.
    – Glorfindel Mod
    Dec 12, 2019 at 11:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .