[转]MySQL 行号

本文转自:http://xi5566.javaeye.com/blog/204753

select *,(select count(*)+1 from table where table.userId<a.userId )as rowId from table as a
注意这里的userId一定要是自增长

posted on 2008-12-23 20:47  freeliver54  阅读(843)  评论(1编辑  收藏  举报

导航