User Counts With < 10

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 
    SUM(CASE WHEN POSTTYPEID = 1 AND SCORE >= 20  THEN 1
             WHEN POSTTYPEID = 2 and SCORE >= 10 THEN 1
             ELSE 0 END) HundredPointPosts,
    OWNERUSERID
FROM
    POSTS p

GROUP BY OWNERUSERID    
ORDER BY
SUM(CASE WHEN POSTTYPEID = 1 AND SCORE >= 20  THEN 1
             WHEN POSTTYPEID = 2 and SCORE >= 10 THEN 1
             ELSE 0 END)

Enter Parameters

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