MySQL select highest rated?

You can do math in the order by clause, like: select * from YourTable order by rating_average * rating_count DESC limit 3 In MySQL, you can add limit at the end of a query to restrict the rowset to the first N rows If you'd give an example, we could probably provide you with a more specific solution.

You can do math in the order by clause, like: select * from YourTable order by rating_average * rating_count DESC limit 3 In MySQL, you can add limit at the end of a query to restrict the rowset to the first N rows. If you'd give an example, we could probably provide you with a more specific solution.

SELECT * FROM table ORDER BY rating_average DESC LIMIT 3 That may work, but you should post the schema so we can see exactly what you want.

If you wanted to limit it to say items with at least 3 ratings, you could do this: SELECT rating_average, rating_count FROM mytable WHERE rating_count > 3 ORDER BY rating_average DESC LIMIT 3.

SELECT * FROM table ORDER BY rating_average DESC, rating_count DESC LIMIT 3 That gives the first 3 rows, sorted first by rating_average and then by rating_count. Example: ================================= | rating_average | rating_count | ================================= | 9.1 | 5 | | 8.9 | 9 | | 8.9 | 3.

1 Two order by's in a row give a syntax error – Andomar Dec 18 '09 at 15:20 copy&paste-error, corrected – Sven Lilienthal Dec 18 '09 at 15:22 Ok, downvote removed :) – Andomar Dec 18 '09 at 15:59.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions