方式1:
简单粗暴的方法,将目标表倒入到一个有自赠属性的表
方式2;
预定义变量
set @mycnt = 0;
select (@mycnt := @mycnt + 1) as ROWNUM , othercol from tblname order by othercol;
方式3:
Select UID,(@rowNum:=@rowNum+1) as rowNo
From tblname,(Select (@rowNum :=0) ) b
方式1:
简单粗暴的方法,将目标表倒入到一个有自赠属性的表
方式2;
预定义变量
set @mycnt = 0;
select (@mycnt := @mycnt + 1) as ROWNUM , othercol from tblname order by othercol;
方式3:
Select UID,(@rowNum:=@rowNum+1) as rowNo
From tblname,