diff options
author | Dan McGee <dan@archlinux.org> | 2014-10-18 17:25:34 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-10-18 17:25:34 -0500 |
commit | a07740f230f733f98200fcb4e4528cc01a3bf2d1 (patch) | |
tree | 712171ada9a05df57e996fc2259812b297025a96 | |
parent | d088579eba892abd990e47dadf9a64a6d1771b42 (diff) |
Change case of SUM() SQL function
-rw-r--r-- | todolists/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
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 |