Sql如下: SELECT ( @id := @id + 1 ) AS id, t.* FROM sys_user t, ( SELECT @id := 0 ) AS id_temp 如果要分页,请把@id的初始值设置为动态传入即可 来源:51CTO作者:pannijingling链接:https://blog.51cto.com/1197822/2478820 标签 索引 mysql索引 select mysql