{"id":486,"date":"2018-05-13T11:01:49","date_gmt":"2018-05-13T04:01:49","guid":{"rendered":"http:\/\/www.sqlservertutorial.net\/?page_id=486"},"modified":"2024-09-24T20:49:24","modified_gmt":"2024-09-24T13:49:24","slug":"sql-server-offset-fetch","status":"publish","type":"page","link":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/","title":{"rendered":"SQL Server OFFSET FETCH"},"content":{"rendered":"\n<p><strong>Summary<\/strong>: in this tutorial, you will learn how to use the SQL Server <code>OFFSET<\/code> <code>FETCH<\/code> clauses to limit the number of rows returned by a query.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='introduction-to-sql-server-offset-fetch'>Introduction to SQL Server OFFSET FETCH <a href=\"#introduction-to-sql-server-offset-fetch\" class=\"anchor\" id=\"introduction-to-sql-server-offset-fetch\" title=\"Anchor for Introduction to SQL Server OFFSET FETCH\">#<\/a><\/h2>\n\n\n\n<p>The <code>OFFSET<\/code> and <code>FETCH<\/code> clauses are options of the <code><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-order-by\/\">ORDER BY<\/a><\/code> clause. They allow you to limit the number of rows returned by a <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select\/\">query<\/a>.<\/p>\n\n\n\n<p>Here&#8217;s the syntax for using the <code>OFFSET<\/code> and <code>FETCH<\/code> clauses:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\">ORDER BY column_list &#91;ASC |DESC]\nOFFSET offset_row_count {ROW | ROWS}\nFETCH {FIRST | NEXT} fetch_row_count {ROW | ROWS} ONLY<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>In this syntax:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The <code>OFFSET<\/code> clause specifies the number of rows to skip before starting to return rows from the query. The <code>offset_row_count<\/code> can be a constant, variable, or parameter that is greater or equal to zero.<\/li>\n\n\n\n<li>The <code>FETCH<\/code> clause specifies the number of rows to return after the <code>OFFSET<\/code> clause has been processed. The <code>offset_row_count<\/code> can be a constant, variable, or scalar that is greater or equal to one.<\/li>\n\n\n\n<li>The <code>OFFSET<\/code> clause is mandatory, while the <code>FETCH<\/code> clause is optional. Additionally, <code>FIRST<\/code> and <code>NEXT<\/code> are synonyms and can be used interchangeably. Similarly, you can use <code>ROW<\/code> and <code>ROWS<\/code> interchangeably.<\/li>\n<\/ul>\n\n\n\n<p>The following picture illustrates the <code>OFFSET<\/code> and <code>FETCH<\/code> clauses:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"343\" height=\"427\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png\" alt=\"SQL Server OFFSET FETCH\" class=\"wp-image-498\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png 343w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-241x300.png 241w\" sizes=\"auto, (max-width: 343px) 100vw, 343px\" \/><\/figure>\n\n\n\n<p class=\"note\">It&#8217;s important to note that you must use the <code>OFFSET<\/code> and <code>FETCH<\/code> clauses with the <code>ORDER BY<\/code> clause. Otherwise, you encounter an error.<\/p>\n\n\n\n<p>The <code>OFFSET<\/code> and <code>FETCH<\/code> clauses are preferable for implementing the query paging solutions compared to the <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select-top\/\">TOP<\/a> clause.<\/p>\n\n\n\n<p class=\"note\">The <code>OFFSET<\/code> and <code>FETCH<\/code> clauses have been available since SQL Server 2012 (11.x) and later, as well as Azure SQL Database.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='sql-server-offset-and-fetch-clause-examples'>SQL Server OFFSET and FETCH clause examples <a href=\"#sql-server-offset-and-fetch-clause-examples\" class=\"anchor\" id=\"sql-server-offset-and-fetch-clause-examples\" title=\"Anchor for SQL Server OFFSET and FETCH clause examples\">#<\/a><\/h2>\n\n\n\n<p>We will use the <code>products<\/code> table from the <a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-sample-database\/\">sample database<\/a> for the demonstration.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"206\" height=\"169\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/products.png\" alt=\"products\" class=\"wp-image-147\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='1-using-the-sql-server-offset-fetch-example'>1) Using the SQL Server OFFSET FETCH example <a href=\"#1-using-the-sql-server-offset-fetch-example\" class=\"anchor\" id=\"1-using-the-sql-server-offset-fetch-example\" title=\"Anchor for 1) Using the SQL Server OFFSET FETCH example\">#<\/a><\/h3>\n\n\n\n<p>The following query uses a <code><a href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-select\/\">SELECT<\/a><\/code> statement to retrieve all rows from the <code>products<\/code> table and sorts them by the list prices and names:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    list_price\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    list_price,\n    product_name;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"254\" height=\"356\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-result-set.png\" alt=\"SQL Server OFFSET FETCH result set\" class=\"wp-image-492\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-result-set.png 254w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-result-set-214x300.png 214w\" sizes=\"auto, (max-width: 254px) 100vw, 254px\" \/><\/figure>\n\n\n\n<p>To skip the first 10 products and return the rest, you use the <code>OFFSET<\/code> clause as shown in the following statement:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    list_price\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    list_price,\n    product_name \n<span class=\"hljs-keyword\">OFFSET<\/span> <span class=\"hljs-number\">10<\/span> <span class=\"hljs-keyword\">ROWS<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"274\" height=\"301\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-example.png\" alt=\"SQL Server OFFSET FETCH example\" class=\"wp-image-490\" srcset=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-example.png 274w, https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-example-273x300.png 273w\" sizes=\"auto, (max-width: 274px) 100vw, 274px\" \/><\/figure>\n\n\n\n<p>To skip the first 10 products and select the next 10 products, you use both <code>OFFSET<\/code> and <code>FETCH<\/code> clauses as follows:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    list_price\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    list_price,\n    product_name \n<span class=\"hljs-keyword\">OFFSET<\/span> <span class=\"hljs-number\">10<\/span> <span class=\"hljs-keyword\">ROWS<\/span> \n<span class=\"hljs-keyword\">FETCH<\/span> <span class=\"hljs-keyword\">NEXT<\/span> <span class=\"hljs-number\">10<\/span> <span class=\"hljs-keyword\">ROWS<\/span> <span class=\"hljs-keyword\">ONLY<\/span>;\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"216\" height=\"207\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-skip-10-rows-fetch-next-10-rows-example.png\" alt=\"SQL Server OFFSET FETCH skip 10 rows fetch next 10 rows example\" class=\"wp-image-493\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id='2-using-the-offset-fetch-clause-to-get-the-top-n-rows'>2) Using the OFFSET FETCH clause to get the top N rows <a href=\"#2-using-the-offset-fetch-clause-to-get-the-top-n-rows\" class=\"anchor\" id=\"2-using-the-offset-fetch-clause-to-get-the-top-n-rows\" title=\"Anchor for 2) Using the OFFSET FETCH clause to get the top N rows\">#<\/a><\/h3>\n\n\n\n<p>The following example uses the <code>OFFSET FETCH<\/code> clause to retrieve the top 10 most expensive products from the <code>products<\/code> table:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"SQL (Structured Query Language)\" data-shcb-language-slug=\"sql\"><span><code class=\"hljs language-sql\"><span class=\"hljs-keyword\">SELECT<\/span>\n    product_name,\n    list_price\n<span class=\"hljs-keyword\">FROM<\/span>\n    production.products\n<span class=\"hljs-keyword\">ORDER<\/span> <span class=\"hljs-keyword\">BY<\/span>\n    list_price <span class=\"hljs-keyword\">DESC<\/span>,\n    product_name \n<span class=\"hljs-keyword\">OFFSET<\/span> <span class=\"hljs-number\">0<\/span> <span class=\"hljs-keyword\">ROWS<\/span> \n<span class=\"hljs-keyword\">FETCH<\/span> <span class=\"hljs-keyword\">FIRST<\/span> <span class=\"hljs-number\">10<\/span> <span class=\"hljs-keyword\">ROWS<\/span> <span class=\"hljs-keyword\">ONLY<\/span>;<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">SQL (Structured Query Language)<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">sql<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"287\" height=\"209\" src=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH-top-10-most-expensive-products.png\" alt=\"SQL Server OFFSET FETCH top 10 most expensive products\" class=\"wp-image-494\"\/><\/figure>\n\n\n\n<p>In this example: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, the <code>ORDER BY<\/code> clause sorts the products by their list prices in descending order. <\/li>\n\n\n\n<li>Then, the <code>OFFSET<\/code> clause skips zero rows, and the <code>FETCH<\/code> clause retrieves the first 10 products from the list.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use the SQL Server <code>OFFSET<\/code> <code>FETCH<\/code> clauses to limit the number of rows returned by a query.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<header>\n\t\t<div class=\"wth-question\">Was this tutorial helpful?<\/div>\n\t\t<div class=\"wth-thumbs\">\n\t\t\t<button\n\t\t\t\tdata-post=\"486\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/\"\n\t\t\t\tdata-post-title=\"SQL Server OFFSET FETCH\"\n\t\t\t\tdata-response=\"1\"\n\t\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t\t<\/button>\n\n\t\t\t<button\n\t\t\t\tdata-response=\"0\"\n\t\t\t\tdata-post=\"486\"\n\t\t\t\tdata-post-url=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/\"\n\t\t\t\tdata-post-title=\"SQL Server OFFSET FETCH\"\n\t\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t\t>\n\t\t\t\t<svg\n\t\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\tfill=\"none\"\n\t\t\t\t\tstroke=\"currentColor\"\n\t\t\t\t\tstroke-width=\"2\"\n\t\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\t>\n\t\t\t\t\t<path\n\t\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t\t><\/path>\n\t\t\t\t<\/svg>\n\t\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t\t<\/button>\n\t\t<\/div>\n\t<\/header>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\n\t\t\t<button class=\"btn btn-primary wth-btn-submit\">Send<\/button>\n\t\t\t<button class=\"btn wth-btn-cancel\">Cancel<\/button>\n\t\t\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":100,"menu_order":2,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-486","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Server OFFSET FETCH<\/title>\n<meta name=\"description\" content=\"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Server OFFSET FETCH\" \/>\n<meta property=\"og:description\" content=\"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Server Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-24T13:49:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/\",\"name\":\"SQL Server OFFSET FETCH\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-OFFSET-FETCH.png\",\"datePublished\":\"2018-05-13T04:01:49+00:00\",\"dateModified\":\"2024-09-24T13:49:24+00:00\",\"description\":\"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-OFFSET-FETCH.png\",\"contentUrl\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/wp-content\\\/uploads\\\/SQL-Server-OFFSET-FETCH.png\",\"width\":343,\"height\":427,\"caption\":\"SQL Server OFFSET FETCH\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/sql-server-offset-fetch\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Server Basics\",\"item\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/sql-server-basics\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server OFFSET FETCH\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/#website\",\"url\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/\",\"name\":\"SQL Server Tutorial\",\"description\":\"The Practical SQL Server Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.sqlservertutorial.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Server OFFSET FETCH","description":"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/","og_locale":"en_US","og_type":"article","og_title":"SQL Server OFFSET FETCH","og_description":"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.","og_url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/","og_site_name":"SQL Server Tutorial","article_modified_time":"2024-09-24T13:49:24+00:00","og_image":[{"url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/","url":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/","name":"SQL Server OFFSET FETCH","isPartOf":{"@id":"https:\/\/www.sqlservertutorial.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/#primaryimage"},"image":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/#primaryimage"},"thumbnailUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png","datePublished":"2018-05-13T04:01:49+00:00","dateModified":"2024-09-24T13:49:24+00:00","description":"This tutorial shows you how to use the SQL Server OFFSET and FETCH clauses to limit the number of rows returned by a query.","breadcrumb":{"@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/#primaryimage","url":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png","contentUrl":"https:\/\/www.sqlservertutorial.net\/wp-content\/uploads\/SQL-Server-OFFSET-FETCH.png","width":343,"height":427,"caption":"SQL Server OFFSET FETCH"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/sql-server-offset-fetch\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlservertutorial.net\/"},{"@type":"ListItem","position":2,"name":"SQL Server Basics","item":"https:\/\/www.sqlservertutorial.net\/sql-server-basics\/"},{"@type":"ListItem","position":3,"name":"SQL Server OFFSET FETCH"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlservertutorial.net\/#website","url":"https:\/\/www.sqlservertutorial.net\/","name":"SQL Server Tutorial","description":"The Practical SQL Server Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlservertutorial.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/comments?post=486"}],"version-history":[{"count":4,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/486\/revisions"}],"predecessor-version":[{"id":4572,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/486\/revisions\/4572"}],"up":[{"embeddable":true,"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/pages\/100"}],"wp:attachment":[{"href":"https:\/\/www.sqlservertutorial.net\/wp-json\/wp\/v2\/media?parent=486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}