Currently I get the average rating for each hour from my SQLite database with the following query:
SELECT AVG(rating) as avgRating, strftime('%H:00', date) as hour FROM ratings
WHERE questionId = 1 AND strftime('%Y-%m-%d', date) = strftime('%Y-%m-%d', 'now')
GROUP BY strftime('%H', date);
Now I want that each hour that doesn't have any value at all, gets the average rating of 0, is this possible?
Aucun commentaire:
Enregistrer un commentaire