From a07740f230f733f98200fcb4e4528cc01a3bf2d1 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 18 Oct 2014 17:25:34 -0500 Subject: Change case of SUM() SQL function --- todolists/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'todolists') diff --git a/todolists/utils.py b/todolists/utils.py index 7b98c887..e04c2e5e 100644 --- a/todolists/utils.py +++ b/todolists/utils.py @@ -6,7 +6,7 @@ from packages.models import Package def todo_counts(): sql = """ -SELECT todolist_id, count(*), sum(CASE WHEN status = %s THEN 1 ELSE 0 END) +SELECT todolist_id, count(*), SUM(CASE WHEN status = %s THEN 1 ELSE 0 END) FROM todolists_todolistpackage WHERE removed IS NULL GROUP BY todolist_id -- cgit v1.2.3