sql 先判断 @cnt = 1 , 然后才执行select 中的 @cnt:=@cnt+1"
set @cnt=0;
select @cnt:=@cnt+1,tbl.* 
from tbl
where @cnt=1;
这为什么没有记录呢。
"因为 @cnt=0, 不符合where 条件.所以没有记录。set @cnt=0;
select @cnt:=@cnt+1,tbl.* 
from tbl
where @cnt=0;就会有一条记录.