有些同学写了很长时间,其实很简单:
select @i:=@i+1 as number,字段,字段 from 表名,(SELECT @i:=0) AS t where 索引 order by 字段 desc