Paginated output
To organize paginated output, we recommend selecting data sorted by primary key sequentially, limiting the number of rows with the LIMIT keyword.
The query in listing 1 demonstrates the recommended way to organize paginated output.
: Primary key values obtained from the previous query.
Listing 1: Query for organizing paginated output
NULL value in key column
In YDB, all columns, including key ones, may have a NULL value. Despite this, using NULL as key column values is highly discouraged, since the SQL standard doesn’t allow NULL to be compared. As a result, concise SQL statements with simple comparison operators won’t work correctly. Instead, you’ll have to use cumbersome statements with IS NULL/IS NOT NULL expressions.