MySQL Forums
Forum List  »  Chinese

URGENT!!! Problem about rank (排序)in mysql server
Posted by: madeinmainland
Date: March 05, 2007 05:59AM

小弟在弄我的毕业final project. 我想在mysql5.0 server中作一个关于排名(RANK)的表格.但是mysql不支持RANK(), ROW_NUMBER()等function. 请各位能人指点下小弟. 我想排名的表格基本是这样的:
+--------+-------+
| user | score |
+--------+-------+
| Monty | 190 |
| Ringo | 89 |
| Zak | 89 |
| Arjen | 89 |
| Joe | 36 |
| Bart | 25 |
| Mo | 19 |
| John | 14 |
| Susan | 12 |
| George | 12 |
| Paul | 4 |
| Pete | 4 |
+--------+-------+

我想加入一个新的列(column)去记录分数排名.请注意,在上面的表格里,有几个score是相同的. 怎样排列(rank) 这样的表格呢? 而且以后再更新(UPDATE)的时候又要怎样处理呢?

由于马上就要交作了,急需各位帮忙.谢谢

Options: ReplyQuote


Subject
Views
Written By
Posted
URGENT!!! Problem about rank (排序)in mysql server
11952
March 05, 2007 05:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.