TOP:
The TOP option in T-SQL feature allows us to limit the number or percentage of rows that the query returns.
It relies on two elements as part of its specifications.
1. Number or percent of rows to return.
2. The ordering of result
We can Use TOP option with PERCENT keyword , in which SQL Server calculates the number of rows to return based on percentage of the number of qualifying rows rounded up.
When TOP is specified with ORDER BY Clause , the ORDER BY clause serves a dual purpose in the Query.
One Purpose is to define presentation ordering for the rows in the query result , Another purpose is to define which rows to filter for TOP.
OFFSET-FETCH:
The OFFSET-FETCH filter is considered part of ORDER BY clause which normally serves a presentation ordering purpose.
The Query that Uses OFFSET-FETCH must have an ORDER BY Clause.
By Using OFFSET Clause , we can indicate how many rows to skip and by using FETCH clause we can indicate how many rows to filter after the skipped rows.
FETCH Clause is not supported without an OFFSET Clause .
OFFSET Without FETCH is allowed, in such scenarios the query skips the indicated number of rows and returns all remaining rows in the result.
Nesta página do site você pode assistir ao vídeo on-line TOP | OFFSET-FETCH | SQL Server | SQL Tutorial duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Uday Bhoyar 20 Novembro 2022, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 538 vezes e gostou 13 espectadores. Boa visualização!