Skip to content

Negative LIMIT specification. #28913

@alexey-milovidov

Description

@alexey-milovidov

Use case

LIMIT -10
- return 10 last records (regardless of total number of records).

Can be combined with negative offset (but not with positive offset).

Describe the solution you'd like

Just implement it.

Describe alternatives you've considered

SELECT * (SELECT ... ORDER BY x DESC LIMIT 10) ORDER BY x ASC

But it's more cumbersome.

Metadata

Metadata

Assignees

Labels

featurewarmup taskThe task for new ClickHouse team members. Low risk, moderate complexity, no urgency.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions