select (@i :=@i+1) as num,id,qzlb
from t_supplier_ca , (select @i:=0) as init where id <>5
(select @i:=0) as init 代表序列的初始值 为0
(@i :=@i+1) 代表递增,每次+1
查询结果
select (@i :=@i+1) as num,id,qzlb
from t_supplier_ca , (select @i:=0) as init where id <>5
(select @i:=0) as init 代表序列的初始值 为0
(@i :=@i+1) 代表递增,每次+1
查询结果