In My Query but not in Rachels

0

Please login or register to vote for this query.

(click on this box to dismiss)

Software Engineering

Q&A for expert programmers interested in professional discussions on software development

SELECT postid ,
        postid [Post Link], text
FROM   posthistory 
WHERE  posthistoryTypeID = 10 
       AND id IN (SELECT ph.id
                      FROM   posthistory ph 
                             OUTER APPLY (SELECT Substring(',' + TEXT + ',', 
                                                 NUMBER + 1 
                                                 , 
                                                 Charindex(',', 
                                                 ',' + TEXT + ',', NUMBER 
                                                         + 
                                                         1) - NUMBER - 1) 
                                                                        AS VALUE 
                                          FROM   MASTER..spt_values 
                                          WHERE  TYPE = 'P' 
                                                 AND NUMBER <= Len( 
                                                     ',' + TEXT + ',') 
                                                               - 1 
                                                 AND Substring(',' + TEXT + ',', 
                                                     NUMBER 
                                                     , 1) 
                                                     = ',' 
                                                 AND ph.posthistorytypeid = 10) 
                                         t 
                      WHERE  ph.posthistorytypeid = 10 
                             AND ( t.VALUE LIKE '"DisplayName":%' 
                                    OR t.VALUE IS NULL ) 
                      GROUP  BY ph.id 
                      HAVING COUNT(t.VALUE) = 5)
AND PostID
NOT IN 

( SELECT 
     p.id
     
FROM
     posts p
     INNER JOIN votes v
       ON p.id = v.PostID
          and v.votetypeid = 6
WHERE
     p.posttypeid = 1 
     and not closeddate is null
GROUP BY 
p.id 
HAVING COUNT(v.id) = 5 )

Enter Parameters

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