您可以在TableQuery对象上使用take和drop方法.它们将在生成的SQL查询中转换为限制和偏移量:
原文链接:https://www.f2er.com/postgresql/192129.htmlval users: TableQuery[UsersTable] = UsersTable.query val firstPartOfUsers = users.drop(0).take(25).result val secondPartOfUsers = users.drop(25).take(25).result
这两个操作将转换为以下SQL查询:
select "name","email","id" from "users" limit 25 offset 0 select "name","id" from "users" limit 25 offset 25