First & Last Date for Posts Bumped N Times by Community User

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for professional and enthusiast programmers

SELECT P.ID, B.BumpCount, B.FirstBump, B.LastBump, P.Title
  FROM Posts AS P
  JOIN (SELECT PostID, COUNT(*) AS BumpCount,
               MIN(CreationDate) AS FirstBump,
                MAX(CreationDate) AS LastBump
          FROM PostHistory
         WHERE PostHistoryTypeID  = 50
         GROUP BY PostID
        HAVING COUNT(*) > 2) AS B
     ON P.ID = B.PostID
 ORDER BY B.BumpCount, P.ID;

Enter Parameters

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