本文转自:http://xi5566.javaeye.com/blog/204753
select *,(select count(*)+1 from table where table.userId<a.userId )as rowId from table as a
注意这里的userId一定要是自增长
本文转自:http://xi5566.javaeye.com/blog/204753
select *,(select count(*)+1 from table where table.userId<a.userId )as rowId from table as a
注意这里的userId一定要是自增长