diff --git a/lib/report/sql_statement.rb b/lib/report/sql_statement.rb index e14efaba1d..69e54b240a 100644 --- a/lib/report/sql_statement.rb +++ b/lib/report/sql_statement.rb @@ -74,15 +74,15 @@ class Report::SqlStatement # FIXME I'm ugly #select("CASE WHEN COUNT(*) >= 10 THEN '10+' ELSE COUNT(*) END as number_of_assessments") - #select("(CASE WHEN users.number_of_assessments >= 10 THEN 10 ELSE users.number_of_assessments END) as number_of_assessments") - #unselect("users.number_of_assessments") + select("(CASE WHEN users.number_of_assessments >= 10 THEN 10 ELSE users.number_of_assessments END) as number_of_assessments") + unselect("users.number_of_assessments") #group_by("number_of_assessments") - #group_not_by("users.sector_id") - #group_by("number_of_assessments") - #group_not_by("users.number_of_assessments") - #group_by("users.sector_id") + group_not_by("users.sector_id") + group_by("number_of_assessments") + group_not_by("users.number_of_assessments") + group_by("users.sector_id") @sql ||= begin sql = "\n-- BEGIN #{desc}\n" \