我有一个表像下面,MYSQL:如何“重新安排”的表格
| id | name | color |
------+--------+---------
| 1 | pear | green |
| 2 | apple | red |
| 3 | banana | yellow |
| 4 | grape | purple |
我想重新排序按字母顺序使用“名称”栏,并用这个新的复位ID(自动增量)为了与以下
| id | name | color |
------+--------+---------
| 1 | apple | red |
| 2 | banana | yellow |
| 3 | grape | purple |
| 4 | pear | green |
问题结束了:我怎么能做到这一点与MYSQL?
为什么你要id顺序匹配名称顺序? – 2009-12-05 00:43:23