Closed lasyka closed 2 years ago
Both Oracle and SQL Server support offset and fetch first like this:
select(foo).from(bar).offset(4).fetchFirst(4).rowsOnly()
Both Oracle and SQL Server support offset and fetch first like this:
select(foo).from(bar).offset(4).fetchFirst(4).rowsOnly()
Thanks for your replay. But this failed for me:
Code:
measureTDynMapper.select(c->c.where(upload,isNotEqualTo("1")).offset(4).fetchFirst(4).rowsOnly());
And the sql from above code is like this:
SELECT
*
FROM
TABLEA
WHERE
upload <> 1 offset 4 ROWS FETCH FIRST 4 ROWS ONLY
This sql will failed execute in sqlserver 2012
[42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]'offset' 附近有语法错误。 (102) [42000] [Microsoft][SQL Server Native Client 11.0][SQL Server]在 FETCH 语句中选项 FIRST 的用法无效。 (153)
You may need to add an order by
expression in SQL Server. See the docs here:
https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2012/ms188385(v=sql.110)
Is this support paging querys for SqlSever or Oracle? the limit,offset is not supported by these databases。