【一条sql语句完成,不set变量】
SELECT @rownum:=@rownum+1 AS rownum, frutas.*
SELECT @rownum:=@rownum+1 AS rownum, frutas.*
FROM (SELECT @rownum:=0) r, frutas;
FROM (SELECT @rownum:=0) r, frutas;