This is an automated email from the ASF dual-hosted git repository.
dzamo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill-site.git
The following commit(s) were added to refs/heads/master by this push:
new 5ba8f34 Document FETCH NEXT count ROWS ONLY syntax of LIMIT.
5ba8f34 is described below
commit 5ba8f34b167c395b67543b792c7714276429aba3
Author: James Turton <[email protected]>
AuthorDate: Wed Sep 15 11:00:03 2021 +0200
Document FETCH NEXT count ROWS ONLY syntax of LIMIT.
---
.../en/sql-reference/sql-commands/084-limit-clause.md | 18 +++++++++++-------
.../en/sql-reference/sql-commands/085-offset-clause.md | 16 ++++++++--------
2 files changed, 19 insertions(+), 15 deletions(-)
diff --git a/_docs/en/sql-reference/sql-commands/084-limit-clause.md
b/_docs/en/sql-reference/sql-commands/084-limit-clause.md
index 92e4c02..c45161e 100644
--- a/_docs/en/sql-reference/sql-commands/084-limit-clause.md
+++ b/_docs/en/sql-reference/sql-commands/084-limit-clause.md
@@ -3,20 +3,25 @@ title: "LIMIT Clause"
slug: "LIMIT Clause"
parent: "SQL Commands"
---
-The LIMIT clause limits the result set to the specified number of rows. You
can use LIMIT with or without an ORDER BY clause.
-Starting in Drill 1.16, you can configure an automatic limit on the number of
rows returned from a result set. See [Setting an Auto Limit on the Number of
Rows Returned for Result
Sets]({{site.baseurl}}/docs/planning-and-execution-options/#setting-an-auto-limit-on-the-number-of-rows-returned-for-result-sets).
+**Introduced in release:** 1.16
+The LIMIT clause limits the result set to the specified number of rows. You
can use LIMIT with or without ORDER BY and OFFSET clauses.
+
+You can also configure an automatic limit on the number of rows returned from
a result set. See [Setting an Auto Limit on the Number of Rows Returned for
Result
Sets]({{site.baseurl}}/docs/planning-and-execution-options/#setting-an-auto-limit-on-the-number-of-rows-returned-for-result-sets).
## Syntax
-The LIMIT clause supports the following syntax:
+The LIMIT clause supports the following syntaxes:
+```sql
+LIMIT { count | ALL }
- LIMIT { count | ALL }
+FETCH NEXT count { ROW | ROWS } ONLY
+```
## Parameters
*count*
Specifies the maximum number of rows to return.
-If the count expression evaluates to NULL, Drill treats it as LIMIT ALL.
+If the count expression evaluates to NULL, Drill treats it as LIMIT ALL.
*ALL*
Specifying ALL returns all records, which is equivalent to omitting the LIMIT
clause from the SELECT statement.
@@ -25,8 +30,7 @@ Specifying ALL returns all records, which is equivalent to
omitting the LIMIT cl
LIMIT 0 quickly returns an empty set. Use LIMIT 0 to test the validity of the
SQL syntax in a complex query or verify that the query is optimized before
running the query on large data sets.
-### Usage Notes
-
+### Usage Notes
- Include the LIMIT 0 clause in the outermost query. Drill does not optimize
LIMIT 0 queries if you include LIMIT 0 in a subquery.
- When you run a query with the LIMIT 0 clause, Drill does not return any rows
from the result set.
diff --git a/_docs/en/sql-reference/sql-commands/085-offset-clause.md
b/_docs/en/sql-reference/sql-commands/085-offset-clause.md
index 0a41c3a..355d8b8 100644
--- a/_docs/en/sql-reference/sql-commands/085-offset-clause.md
+++ b/_docs/en/sql-reference/sql-commands/085-offset-clause.md
@@ -7,14 +7,14 @@ The OFFSET clause provides a way to skip a specified number
of first rows in a r
## Syntax
The OFFSET clause supports the following syntax:
-
- OFFSET start { ROW | ROWS }
-
+```sql
+OFFSET start { ROW | ROWS }
+```
## Parameters
-*rows*
+*rows*
Specifies the number of rows Drill should skip before returning the result
set.
-## Usage Notes
+## Usage Notes
* The OFFSET number must be a positive integer and cannot be larger than
the number of rows in the underlying result set or no rows are returned.
* You can use the OFFSET clause in conjunction with the LIMIT and ORDER BY
clauses.
* When used with the LIMIT option, OFFSET rows are skipped before starting
to count the LIMIT rows that are returned. If the LIMIT option is not used, the
number of rows in the result set is reduced by the number of rows that are
skipped.
@@ -22,6 +22,6 @@ Specifies the number of rows Drill should skip before
returning the result set.
## Examples
The following example query returns the result set from row 101 and on,
skipping the first 100 rows of the table:
-
- SELECT * FROM dfs.logs OFFSET 100 ROWS;
-
+```sql
+SELECT * FROM dfs.logs OFFSET 100 ROWS;
+```