Updated on 2026-05-15 GMT+08:00

LIMIT

Syntax of Analysis Statements

The syntax of a complete analysis statement is as follows:

1
2
3
4
SELECT [DISTINCT] (* | expression) [AS alias] [, ...]
[GROUP BY expression [, ...] [HAVING predicates]]
[ORDER BY expression [ASC | DESC] [, ...]]
[LIMIT size OFFSET offset]

Where, LIMIT indicates the number of returned data records. The following part describes parameters and examples for the LIMIT syntax.

Specifying the Number of Returned Records

Query and display the first log.

1
*|SELECT * LIMIT 1
Table 1 Specifying the number of returned records

account_number

firstname

gender

city

balance

employer

state

lastname

age

1

Amber

M

Brogan

39225

Pyrami

IL

Duke

32

Specifying the Number of Returned Records and Offsets

Query and display the second log.

1
*|SELECT * LIMIT 1 OFFSET 1
Table 2 Specifying the number of returned records and offsets

account_number

firstname

gender

city

balance

employer

state

lastname

age

16

Hattie

M

Dante

5686

Netagy

TN

Bond

36