Paging records page 4
New features of Standard, which have been included into A database management system (DBMS) by Microsoft Corporation. SQL(Structured Query Language) is a database computer language designed for the retrieval and management of data in relational database management systems (RDBMS), database schema creation and modification, and database object access control management.SQL Server 2012, make paging a very simple procedure. We are talking about new optional keywords in ORDER BY clause, namely OFFSET and FETCH. These new keywords allow you to specify how many rows from the query result have to be returned to client and from which row they should be begun.
Now this expanded syntax of ORDER BY clause takes the form:
FIRST and NEXT are synonyms as well as ROW and ROWS, i.e. you can use any of two variants.
integer_expression_2 presents a number of rows which have to be returned, whereas integer_expression_1 is a number of rows from the beginning of sorted result set, which need to be missed before return. If FETCH keyword is absent, all rows will be returned beginning from integer_expression_1 + 1.
With aid of these new features, paging procedure which has been considered above can be rewritten in a very simple manner:
Note that standard syntax of ORDER BY clause is supported by PostgreSQL also.