I recently noticed there is a bug related to what a close question is.
A closed question should be either:
- A question that has been explicitly closed
- If the Close questions with a selected answer setting is enabled, a question that has a selected answer
In some parts of the core, a closed question is taking into account both conditions but in general only the first one is taken into account.
So, if you have have not enabled the Close questions with a selected answer setting, then just run this query:
SELECT * FROM `qa_posts`
WHERE `type` LIKE 'Q%' AND `closedbyid` IS NOT NULL
If you have enabled that setting then run this query:
SELECT * FROM `qa_posts`
WHERE `type` LIKE 'Q%' AND (`closedbyid` IS NOT NULL OR `selchildid` IS NOT NULL)
In both cases, if you want to get just a column with the URL, rather than just all the raw data, you can do something like this (then add the appropriate WHERE conditions based on the previous SQL statements):
SELECT CONCAT(
(SELECT `content` FROM `qa_options`WHERE `title` = 'site_url' ),
`postid`
) `url`,
`qa_posts`.*
FROM `qa_posts`
WHERE ...