HuntingBugsInBountyJoins

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

select u.DisplayName as Sponsor,
       q.OwnerUserId as AskerID,
       bo.Id as BountyOfferID,
       bo.BountyAmount as BountyOfferAmount,
       a.OwnerUserId as [User Link],
       a.Id as [Post Link],
       bc.Id as BountyReceiveID,
       bc.BountyAmount as BountyReceiveAmount
from posts q
     inner join votes bo on q.id = bo.PostId
     inner join users u on u.id = bo.UserId
     left join Posts a on q.Id = a.ParentId
     left join votes bc on a.Id = bc.PostId
where bo.UserId = 11227
  and bo.VoteTypeId = 8
  and q.OwnerUserId != u.Id
  and q.PostTypeId = 1
  and a.PostTypeId = 2
  and bc.VoteTypeId = 9

Enter Parameters

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