OPEN Cross-site duplicate questions by same user.


Please login or register to vote for this query.

(click on this box to dismiss)

Code Review

Q&A for peer programmer code reviews

  SOUsers AS (
    SELECT *
    FROM [StackOverflow]..Users
  SOQuestions AS (
    SELECT *
    FROM [StackOverflow]..Posts
    WHERE PostTypeId = 1 AND ClosedDate IS NULL
  Questions AS (
    SELECT *
    FROM Posts
    WHERE PostTypeId = 1 AND ClosedDate IS NULL
SELECT --U.AccountID,
  U.ID AS [User Link], Q.ID AS [Post Link], 
  Q.CreationDate AS Created, Q.ViewCount AS Vws, 
  Q.AnswerCount AS Ans, Q.Score AS Scr,
  '' + CAST(SU.ID as varchar) +
    '|' + SU.DisplayName AS [SOProfileLink],
  '' + CAST(SQ.ID as varchar) +
    '|' + SQ.Title AS [SOQuestionLink],
  SQ.CreationDate AS Created, SQ.ViewCount AS Vws, 
  SQ.AnswerCount AS Ans, SQ.Score AS Scr
FROM Users U
  INNER JOIN Questions Q ON Q.OwnerUserID = U.ID
  INNER JOIN SOUsers SU ON SU.AccountID = U.AccountID
  INNER JOIN SOQuestions SQ ON SQ.OwnerUserID = SU.ID
WHERE SQ.Title = Q.Title

Enter Parameters

Switch sites:
loading Hold tight while we fetch your results