Which of my answers received more votes than the accepted answer?

1

Please login or register to vote for this query.

(click on this box to dismiss)

Computational Science Meta

Q&A about the site for scientists using computers to solve scientific problems

WITH Utable AS
(
SELECT
Id AS AnswerId,
ParentId AS QuestionId,
Score AS Uscore
FROM Posts  
WHERE
  OwnerUserId = 7128934  
  AND Posts.PostTypeId = 2
  AND Posts.ParentId IN
    (SELECT Posts.Id FROM Posts WHERE Posts.AcceptedAnswerId IS NOT NULL)
),
OTable AS
(
SELECT Score AS Oscore,
ParentId AS Oqid,
Id AS Oaid
FROM Posts
WHERE Posts.ParentId IN (SELECT QuestionId FROM UTable)
AND Posts.Id IN (SELECT DISTINCT AcceptedAnswerId FROM Posts)
)
SELECT DISTINCT
Id AS [Post Link],
Utable.AnswerId,
Otable.Oaid,
OTable.OScore,
Utable.Uscore
FROM Posts
  INNER JOIN Utable ON Utable.QuestionId = Posts.Id
  INNER JOIN Otable ON Otable.Oqid = Posts.Id

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results