SELECT * FROM (SELECT Users.id as id,name,sign,account,audit,roleName,RoleId, Users.deleteFlag as deleteFlag, ROW_NUMBER() OVER (ORDER BY Users.createdAt) AS Seq FROM Users LEFT JOIN Roles ON Users.RoleId=Roles.id)Users Where deleteFlag=0 and Seq > :offset_num and Seq<= :offset_num+:limit_num