Skip to content

Commit

Permalink
fixes #16 - do not use ISNULL mysql function in raw query - use fonct…
Browse files Browse the repository at this point in the history
…ion compliant for sqlite as well instead
  • Loading branch information
dmartin35 committed May 22, 2024
1 parent 1d6184a commit 6b3ade9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions season/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def user_table_with_bonus():
c.scores,
c.issues,
c.matches,
c.points + IF (ISNULL(c.bonus),0,c.bonus) as total,
c.points + COALESCE(c.bonus,0) as total,
c.bonus
FROM(
SELECT * from
Expand All @@ -471,7 +471,7 @@ def user_table_with_bonus():
)b
ON a.id = b.user_id
)c
ORDER BY ISNULL(total)ASC, total DESC, points DESC, scores DESC,
ORDER BY COALESCE(total,0) DESC, points DESC, scores DESC,
issues DESC, matches, name, id
"""
#ISNULL(total) ASC, total -->MySql
Expand Down

0 comments on commit 6b3ade9

Please sign in to comment.