mysql 产生自增列

SET @NUM=0;
select @NUM:=@NUM+1, catname from xd_category where parentid=2778 

#SELECT @NUM:=@NUM+1

你可能感兴趣的:(mysql)