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
Post a Comment