bumps&stuff

0

Please login or register to vote for this query.

(click on this box to dismiss)

CiviCRM

Q&A for administrators and users of the CiviCRM Constituent Relationship Management software

SELECT 
  PostHistory.PostId,
  (
    SELECT COUNT(Hist.Id)
    FROM
      PostHistory as Hist
    WHERE
      Hist.PostId = PostHistory.PostId AND
      Hist.PostHistoryTypeId = 50 AND
      Hist.CreationDate < '2021-12-01'
  ) as 'Total Bumps'
FROM
  PostHistory
WHERE
  PostHistory.PostHistoryTypeId = 50 AND
  PostHistory.CreationDate < '2021-12-01'
GROUP BY
  PostHistory.PostId
ORDER BY
  'Total Bumps' DESC

Enter Parameters

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