Do we lose the right to answer a question if you used your re-open hammer?

0

Please login or register to vote for this query.

(click on this box to dismiss)

https://meta.stackoverflow.com/questions/361472/do-we-lose-the-right-to-answer-a-question-if-you-used-your-re-open-hammer

Stack Overflow

Q&A for professional and enthusiast programmers

declare @binding nvarchar(60) = '"BindingReason":{"GoldTagBadge"'

select dh.postid as [Post Link]
     , dh.creationdate
     , p.owneruserid as [User Link]
     , p.id as [Post Link]
from
(
select  ph.postid
   --  , ph.text [who re-openened that question]
       , ph.creationdate
    -- , reverse(ph.text)
    -- , charindex( reverse(@binding), reverse(ph.text)) as [pos]
   /*  , charindex( 
          reverse('"Id":') , 
          reverse(ph.text) , 
          charindex( reverse(@binding), reverse(ph.text))
       ) as [id_pos] */
       -- reversing the text let you parse to 
       -- the userid that used their gold badge hammer
       -- once you found all charindexes, you can translate 
       -- back and substring the userid out of the text
     , substring(
         ph.text ,
         len(ph.text) - 
         charindex( 
          reverse('"Id":') , 
          reverse(ph.text) , 
          charindex( reverse(@binding), reverse(ph.text))
          ) + 2 ,
          
          charindex(',', ph.text,
            len(ph.text) - 
            charindex( 
              reverse('"Id":') , 
              reverse(ph.text) , 
              charindex( reverse(@binding), reverse(ph.text))
            )
          ) - (len(ph.text) - 
         charindex( 
          reverse('"Id":') , 
          reverse(ph.text) , 
          charindex( reverse(@binding), reverse(ph.text))
          )) -2 ) as [golduserid]
from posthistory ph
where posthistorytypeid = 11 -- reopen
and text like N'%' + @binding + N'%'
) as dh
inner join posts p on p.parentid = dh.postid
and p.creationdate > dh.creationdate
and p.owneruserid = dh.golduserid
order by p.owneruserid
       , p.creationdate desc

Enter Parameters

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