Skip to content

Instantly share code, notes, and snippets.

@kakha13
kakha13 / Rating System Query
Last active December 28, 2015 23:19
100% cool rating system query for SQL that will give you right result. Score and Timer calculation Rating
-- BY Kakha Giorgashvili (KAKHA13)
-- Rating system query
-- score = Users Score
-- timer = Interval from begining to end
-- 1.8 is gravity what helps query to get 100% right result
SELECT
*,
(`score` - 1) / POWER(`timer`, 1.8) AS rating
FROM