Skip to content

Instantly share code, notes, and snippets.

@heyajulia
Last active February 19, 2022 13:22
Show Gist options
  • Save heyajulia/3bfe4072d3878d2dd4229a9f9695ee30 to your computer and use it in GitHub Desktop.
Save heyajulia/3bfe4072d3878d2dd4229a9f9695ee30 to your computer and use it in GitHub Desktop.
A SEDE query to find questions a user has answered that don't have an acccepted answer. https://data.stackexchange.com/stackoverflow/query/1559991/find-questions-a-user-has-answered-that-dont-have-an-acccepted-answer
DECLARE @UserId int = ##UserId##
SELECT
Id AS [Post Link],
-- TODO: Select user's answer score as well
Score AS [Question Score]
FROM
Posts
WHERE
Id IN
(
-- Select the question IDs of user's answers
SELECT
ParentId
FROM
Posts
WHERE
OwnerUserId = @UserId
AND PostTypeId = 2 -- Answers
)
AND AcceptedAnswerId IS NULL
ORDER BY
CreationDate DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment