Skip to content

Commit

Permalink
Replace sqlite queries that were using iif functions with backward co…
Browse files Browse the repository at this point in the history
…mpatible CASE statement
  • Loading branch information
syt0r committed Jan 28, 2024
1 parent 3d92351 commit cc89a4f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,15 @@ SELECT COUNT(*)
FROM writing_review;

getTotalWritingReviewsDuration:
SELECT SUM(IIF(duration > :reviewDurationLimit, :reviewDurationLimit, duration))
SELECT SUM(CASE WHEN duration > :reviewDurationLimit THEN :reviewDurationLimit ELSE duration END)
FROM writing_review;

getTotalReadingReviewsCount:
SELECT COUNT(*)
FROM reading_review;

getTotalReadingReviewsDuration:
SELECT SUM(IIF(duration > :reviewDurationLimit, :reviewDurationLimit, duration))
SELECT SUM(CASE WHEN duration > :reviewDurationLimit THEN :reviewDurationLimit ELSE duration END)
FROM reading_review;

getTotalUniqueReviewedCharactersCount:
Expand Down

0 comments on commit cc89a4f

Please sign in to comment.