MySQL要用变量如:
set @row=0
select
*
from
(
select (@row:=@row+1) as RowNum,* from 表--这里加排序用Order by
)as A
SQL Server --Row_Number
Oracle--Row_number/rownum
SELECT @rownum :=@rownum + 1 rownum,name
FROM
(SELECT @rownum := ((pageNo-1)*pageSize),name
FROM
mytest
LIMIT (pageNo-1)*pageSize,pageSize
) t
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)