OPEN Cross-site duplicate questions by same user.

0

Please login or register to vote for this query.

(click on this box to dismiss)

Code Review

Q&A for peer programmer code reviews

WITH
  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,
  'http://stackoverflow.com/users/' + CAST(SU.ID as varchar) +
    '|' + SU.DisplayName AS [SOProfileLink],
  'http://stackoverflow.com/questions/' + 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

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