set @id:=0;
select (@id:=@id:+1) as id,‘列名’ from '表名'
第二种写法
select (@id:=@id:+1) as id,‘列名’ from '表名',(select @id:=0) as '别名'
set @id:=0;
select (@id:=@id:+1) as id,‘列名’ from '表名'
第二种写法
select (@id:=@id:+1) as id,‘列名’ from '表名',(select @id:=0) as '别名'