All bounties

0

Please login or register to vote for this query.

(click on this box to dismiss)

Movies and TV Meta

Q&A about the site for movie and tv enthusiasts

SELECT
  PostsWithDeleted.CreationDate as 'Question Date',
  'site://questions/'+CONVERT(VARCHAR(15),PostsWithDeleted.Id) +
   (CASE WHEN PostsWithDeleted.Title IS NULL
      THEN '|[deleted:' + CONVERT(VARCHAR(15),PostsWithDeleted.Id) + ']'
      ELSE '|' + PostsWithDeleted.Title
    END
   )
  AS 'Post Link',
  (CASE
        WHEN Users.DisplayName IS NULL
        THEN '[deleted:' + PostsWithDeleted.OwnerDisplayName + ']'
        ELSE
         'site://users/'
           + CONVERT(VARCHAR(15),PostsWithDeleted.OwnerUserId)
           + '|'
           + Users.DisplayName
       END
      )
    AS 'Question Poster',
  'site://users/'
    + CONVERT(VARCHAR(15),PostNotices.OwnerUserId)
    + '|'
    + (CASE
        WHEN PostUser.DisplayName IS NULL
        THEN '[deleted:'+CONVERT(VARCHAR(15),PostNotices.OwnerUserId)+']'
        ELSE PostUser.DisplayName
       END
      )
    AS 'Bounty Poster'
FROM
  PostsWithDeleted
    INNER JOIN PostNotices ON PostsWithDeleted.Id = PostNotices.PostId
    INNER JOIN PostNoticeTypes ON PostNotices.PostNoticeTypeId = PostNoticeTypes.Id
    LEFT JOIN Users ON PostsWithDeleted.OwnerUserId = Users.Id
    LEFT JOIN Users AS PostUser ON PostNotices.OwnerUserId = PostUser.Id
WHERE
  PostsWithDeleted.PostTypeId = 1
   AND PostNoticeTypes.ClassId = 2
   AND (Users.Id IS NULL OR Users.Id <> PostNotices.OwnerUserId)
ORDER BY
  PostsWithDeleted.CreationDate DESC

Enter Parameters

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