第一种方法:
select (@i:[email protected]+1) as i,table_name.* from table_name,(select @i:=0) as it
第二种方法:
set @rownum=0;
select @rownum:[email protected]+1 as rownum, t.username from auth_user t limit 1,5;
时间: 2024-10-30 04:42:42
第一种方法:
select (@i:[email protected]+1) as i,table_name.* from table_name,(select @i:=0) as it
第二种方法:
set @rownum=0;
select @rownum:[email protected]+1 as rownum, t.username from auth_user t limit 1,5;