我想只从Stack Exchange API的/questions
获得封闭式问题。
我玩了一些过滤器,我为每个问题提出了something which gives我这样的JSON:
{
"tags": [
"c++",
"opencl",
"intel"
],
"close_vote_count": 0,
"title": "Weird OpenCL calls side effect on C++ for loop performance",
"body": "<p>I'm working on a C++ project using OpenCL. I'm using the CPU as an OpenCL device with the <a href=\"http://registrationcenter.intel.com/irc_nas/5193/intel_code_builder_for_opencl_2015_ubuntu_5.0.0.43_x64.tgz\" rel=\"nofollow\">intel OpenCL runtime</a></p>[...]"
},
现在,我只想要关闭的问题。
我该怎么做?
(另一件事:我怎么能从结果中排除封闭的问题?)
答案 0 :(得分:1)
您可以使用以下查询轻松完成此操作:
SELECT count(*)
FROM Posts
WHERE ClosedDate IS NOT NULL
然而,这并没有告诉您关闭的原因,为了获得这个,您应该查看PostHistoryTable
,其中包含与帖子相关的所有更改的详细信息。