Returns non-deleted questions where the given UserID has cast a binding gold badger duplicate close vote. Plagiarized from rene's answer here: https://meta.stackexchange.com/a/234057
Q&A for professional and enthusiast programmers
declare @userid as nvarchar(32) declare @uid as int = ##UserId## select @userid='"Id":'+cast(@uid as nvarchar)+',' select postid as [Post Link] , @userid, len(@userid) , [text] , reverse([text]) , charindex(':"dI"{', reverse([text])) , charindex(reverse(@userid), reverse([text])) from posthistory where posthistorytypeid = 10 and (comment = 101 OR comment = 1) and [text] like '%'+@userid+'%' and [text] like '%BindingReason%' and (charindex(':"dI"{', reverse([text])) - (len(@userid)-5) = charindex(reverse(@userid), reverse([text]))) ORDER BY creationdate