Mysql分页
程序员文章站
2022-06-06 18:19:28
...
分页 在 mysql 用 limit,在sql server用 top,在oracle用rownum。用hibernate的话有分页方法。
代码如下:
int
cpage =
2
;
int
pageSize =
10
;
int
startIndex = (cpage-
1
)*pageSize;
String sql =
"select * from deployees from departmentid='1001' limit "
+startIndex+
","
+pageSize;
....