/**
* Returns count of unique site/user combinations.
*/
SELECT count(DISTINCT(uuid)) FROM `pmapi_pum_reviews`
/**
* Get count of each reason.
* Use Having to limit these results or pivot the table.
*/
SELECT `reason`, COUNT(*) FROM `pmapi_pum_reviews` GROUP BY `reason`
/**
* Get count & percentage of each reason.
* Use Having to limit these results or pivot the table.
*/
SELECT reason, COUNT(*) AS count, concat(FORMAT((SUM(100) / total),2),'%') AS percentage FROM `pmapi_pum_reviews` CROSS JOIN (SELECT COUNT(*) AS total FROM `pmapi_pum_reviews` ) x GROUP BY reason
/**
* Get list of reasons with more than 3 submissions.
*/
SELECT `reason`, count(*) from `pmapi_pum_reviews` group by `reason` having count(*) > 3