select @rownum:=@rownum+1 as rownum, b.* from (select @rownum:=0) a, b

b表是数据表

相关文章: