Distribution of Views among Users

0

Please login or register to vote for this query.

(click on this box to dismiss)

Joomla Meta

Q&A about the site for Joomla! administrators, users, developers and designers

SELECT SUM(CASE WHEN Views =0 THEN 1 END) AS [0],
SUM(CASE WHEN Views >0 AND Views < 10 THEN 1 END) AS [1,10],
SUM(CASE WHEN Views >=10 AND Views < 50 THEN 1 END) AS [10,50],
SUM(CASE WHEN Views >=50 AND Views < 100 THEN 1 END) AS [50,100],
SUM(CASE WHEN Views >=100 AND Views < 150 THEN 1 END) AS [100,150],
SUM(CASE WHEN Views >=150 AND Views < 500 THEN 1 END) AS [150,500],
SUM(CASE WHEN Views >=500 AND VIEWS < 1000 THEN 1 END) AS [500, 1000],
SUM(CASE WHEN Views >=1000 AND Views < 10000 THEN 1 END) AS [1000,10000],
SUM(CASE WHEN Views >=10000 AND Views < 50000 THEN 1 END) AS [10000,50000],
SUM(CASE WHEN Views >=50000 THEN 1 END) AS [50000,inf]
FROM Users

Enter Parameters

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