I have a table with five fields:
ITEMS
id
title
text
rating
numvotes
I want to order the items by their rating.
First approach:
Not very good.Code:SELECT * FROM items ORDER BY rating DESC LIMIT 10;
Second approach:
Better.Code:SELECT * FROM items ORDER BY rating DESC WHERE numvotes > 5 LIMIT 10;
However, I would like it that the following:
would score higher thanCode:rating: 4,3 (out of 5) numvotes 150
Since it has alot more votes and is thus a better representation.Code:rating 4,4 numvotes 10
How would I be able to do something like that?




Bookmarks