mysql结果里set自增列

 

select (@i:=@i+1) i,a.* from ads_building_street a,(select @i:=0) it;

结果:

 

 set @num =0 ;

SELECT @num:=@num+1 as id,a.name FROM ads_building_street a;

 

posted @ 2020-03-26 17:19  代码伊甸园  阅读(548)  评论(0编辑  收藏  举报