Most Viewed Questions Answered

1

Please login or register to vote for this query.

(click on this box to dismiss)

スタック・オーバーフロー

プログラマーとプログラミングに熱心な人々のための質問と回答

DECLARE @UserId INT = ##UserId:INT?9814069##
-- After editing, remove ?9814069
-- How to return Yes/No if AID=MID?

SELECT 
    TOP ##TopCount:INT?10##
    q.Id AS [Post Link],
    qu.Id AS [User Link],
    q.CreationDate AS Created,
    q.ViewCount AS Views,
    q.AnswerCount AS AC,
    q.AcceptedAnswerId AS AID,
    a.Id AS MID,
    q.Score AS QS,
    a.Score AS MS,
    q.CommentCount AS QC,
    a.CommentCount AS MC,
    q.Tags

FROM Posts a 
JOIN Posts q ON a.ParentID=q.Id
JOIN Users qu ON q.OwnerUserId=qu.Id

WHERE a.OwnerUserId=@UserId
-- Ideas:
-- AND q.CreationDate >= '2024-01-01'
-- AND q.AcceptedAnswerId=a.Id

ORDER BY Views DESC

Enter Parameters

Options:
Switch to meta site
loading Hold tight while we fetch your results