mysql分页技术中用到的关键字
mysql数据库分页用limit关键字,它后面跟两个参数:startIndex和pageSize。如:请求第2页,每页10条数据,departmentId代表部门编码,以科研部的员工为例,假设其部门编码为1001Java code:
int cpage = 2;int pageSize = 10;int startIndex = (cpage-1)*pageSize;String sql = "select * from deployees from departmentid='1001' limit "+startIndex+","+pageSize;