SELECT (@rownum:=@rownum + 1) AS 编号,a.* FROM (SELECT @rownum:=0) i,calendar a;
想要显示出固定行数的方式:
SELECT (@rownum:=@rownum + 1) AS 编号,a.* FROM (SELECT @rownum:=0) i,calendar a LIMIT 1,8