# Beyond LIMIT, Presto meets OFFSET and TIES

DevFeed: [Beyond LIMIT, Presto meets OFFSET and TIES](<https://devfeed.tech/articles/beyond-limit-presto-meets-offset-and-ties-8633.md>)

Original publisher: [Read original article](<https://trino.io/blog/2020/02/03/beyond-limit-presto-meets-offset-and-ties.html>)

Author: Piotr Findeisen, Starburst Data

Published: 2020-02-03T00:00:00Z

Content type: article

Language: en

Sources: [Trino Blog](<https://devfeed.tech/sources/trino-blog.md>)

Topics: [SQL](<https://devfeed.tech/topics/sql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [big-data](<https://devfeed.tech/topics/big-data.md>)

Tags: [big-data](<https://devfeed.tech/tags/big-data.md>), [relational-databases](<https://devfeed.tech/tags/relational-databases.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

The article explains how Presto added ANSI SQL support for limiting query results, including skipping initial rows with OFFSET and retaining all rows tied with the final result using TIES. It contrasts the standard syntax with Presto's existing shorthand and discusses its usefulness for ad-hoc queries over big data sets.

## Source excerpt

Presto follows the SQL Standard faithfully. We extend it only when it is well justified, we strive to never break it and we always prefer the standard way of doing things. There was one situation where we stumbled, though. We had a non-standard way of limiting query results with LIMIT n without implementing the standard way of doing that first. We have corrected that, adding ANSI SQL way of limiting query results, discarding initial results and - a hidden gem - retaining initial results in case of ties.