Created
April 5, 2012 08:04
-
-
Save a1phanumeric/2308893 to your computer and use it in GitHub Desktop.
How to sort by average user rating correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT widget_id, ((positive + 1.9208) / (positive + negative) - 1.96 * SQRT((positive * negative) / (positive + negative) + 0.9604) / (positive + negative)) / (1 + 3.8416 / (positive + negative)) AS ci_lower_bound FROM widgets ORDER BY ci_lower_bound DESC; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment