Limit and offset
Limit
- Kotlin
- SQL
val firstByName = ShopTable
.orderBy(ShopTable.name)
.limit(1)
.perform(db)
SELECT T0."id" c0
, T0."name" c1
, T0."address" c2
, T0."established" c3
FROM "Shop" T0
ORDER BY T0."name" ASC
LIMIT 1
Offset
- Kotlin
- SQL
val thirdByName = ShopTable
.orderBy(ShopTable.name)
.offset(2)
.limit(1)
.perform(db)
SELECT T0."id" c0
, T0."name" c1
, T0."address" c2
, T0."established" c3
FROM "Shop" T0
ORDER BY T0."name" ASC
LIMIT 1
OFFSET 2
Offset without limit
- Kotlin
- SQL
ShopTable
.orderBy(ShopTable.name)
.offset(2)
.perform(db)
SELECT T0."id" c0
, T0."name" c1
, T0."address" c2
, T0."established" c3
FROM "Shop" T0
ORDER BY T0."name" ASC
OFFSET 2