Score vs. Number of bookmarks

0

Please login or register to vote for this query.

(click on this box to dismiss)

Craft CMS Meta

Q&A about the site for administrators, end users, developers and designers for Craft CMS

SELECT COUNT(*) AS 'Total questions',
  SUM(IIF(Score > COALESCE(FavoriteCount, 0), 1, 0)) AS 'Score > Bookmarks',
  SUM(IIF(Score = COALESCE(FavoriteCount, 0), 1, 0)) AS 'Score = Bookmarks',
  SUM(IIF(Score < COALESCE(FavoriteCount, 0), 1, 0)) AS 'Score < Bookmarks'
  FROM Posts
  WHERE PostTypeId = 1 -- Questions

Enter Parameters

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