sql - Sorting Results in Mysql -


i have table looks this, name person's name, , votes how many people have rated person, , rating_percent rating percent 5.0 highest. question is, best way sort them depending on number of votes , rating_percent. , can give me sample code.

|   id   |  name    |   votes   |   rating_percent  | |   1    |  george  |   12      |       4.5         | |   2    |  pamela  |   1       |       5.0         | |   3    |  britney |   22      |       3.2         | |   4    |  lucas   |   43      |       1.2         | |   5    |  bobby   |   54      |       2.4         | 

th query be

select * table_name order votes desc, rating_percent desc 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -