Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- a.id_concessionaria,
- a.avscore,
- @rank := @rank + 1 AS ranking
- FROM
- (
- SELECT
- id_concessionaria,
- Avg(rating) AS AvScore
- FROM
- dealer_ratings
- GROUP BY
- id_concessionaria
- ) a
- ORDER BY
- a.avscore DESC
- 12286 5.0000 1
- 11393 5.0000 2
- 11784 5.0000 3
- 11816 5.0000 4
- 12291 4.3333 5 --------------------- Essa aqui
- 12634 4.0000 6
- 19021 3.0000 7
- 10194 2.0000 8
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement