mysql命令with duplicates,可选参数?

时间:2012-05-20 13:31:00

标签: mysql

例如,列rating的所有行的值均为零。 ORDER BY rating DESC将是主要的,有没有办法进行辅助ORDER BY

如果ORDER BY rating DESC有重复项,那么请ORDER BY name DESC吗?这可能吗?


 id   | name  | rating
  1   | one   |  0
  2   | two   |  0
  3   | three |  0
  4   | four  |  0
  5   | five  |  0
  6   | six   |  0

1 个答案:

答案 0 :(得分:3)

只需在order by子句

中添加第二列即可
ORDER BY rating DESC, name DESC