hacked sql statement for partition

pull/6827/head
Markus Kahl 14 years ago
parent a50a812bc1
commit b212b2f282
  1. 12
      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" \

Loading…
Cancel
Save