And because ordering is non-deterministic, it may as well be the same result as from the select "top 1". Shadi Namrouti Shadi Namrouti 1, 13 Sign up using Facebook. The correct ms sql select bottom should be that there is not, and cannot be, an equivalent to TOP for getting the bottom rows. I want to calculate the last row minus the first row, as shown here:.
What is the Difference between TOP and OFFSET & Fetch?
Querying a simple subquery sorted descending, followed by sorting on the same column ascending does the trick. Proposed as answer by selva Tuesday, March 18, So what would last mean? Wednesday, December 3, 8:
how to select Bottom( N) rows in a table through single query.
Tuesday, March 18, You said, because the situation shouldn't exist what situation? At the moment the server allows you to avoid this performance penalty if you don't need this information.