{"id":2647,"date":"2013-08-10T09:00:17","date_gmt":"2013-08-10T09:00:17","guid":{"rendered":"http:\/\/www.withdata.com\/ad\/?p=2647"},"modified":"2017-04-20T10:56:15","modified_gmt":"2017-04-20T10:56:15","slug":"how-to-limit-the-number-of-rows-returned-by-an-mysql-query","status":"publish","type":"post","link":"https:\/\/www.withdata.com\/blog\/mysql\/how-to-limit-the-number-of-rows-returned-by-an-mysql-query.html","title":{"rendered":"How to limit the number of rows returned by an MySQL query"},"content":{"rendered":"<p>In MySQL, you can use &#8220;LIMIT &lt;skip&gt; &lt;count&gt;&#8221;, like this:<\/p>\n<pre>select *\r\nfrom sometable\r\norder by name\r\nlimit 20,10<\/pre>\n<p>In Oracle: <a href=\"https:\/\/www.withdata.com\/blog\/oracle\/how-to-limit-the-number-of-rows-returned-by-an-oracle-query-after-ordering.html\">https:\/\/www.withdata.com\/blog\/oracle\/how-to-limit-the-number-of-rows-returned-by-an-oracle-query-after-ordering.html<\/a> .<\/p>\n<p>In SQL Server:\u00a0<a href=\"https:\/\/www.withdata.com\/blog\/sql-server\/the-sql-server-equivalent-for-the-mysql-limit.html\">https:\/\/www.withdata.com\/blog\/sql-server\/the-sql-server-equivalent-for-the-mysql-limit.html<\/a>\u00a0.<\/p>\n<p>In DB2:\u00a0<a href=\"https:\/\/www.withdata.com\/blog\/db2\/the-db2-equivalent-for-the-mysql-limit.html\">https:\/\/www.withdata.com\/blog\/db2\/the-db2-equivalent-for-the-mysql-limit.html<\/a>\u00a0.<\/p>\n<p>In Sqite: <a href=\"https:\/\/www.withdata.com\/blog\/sqlite\/how-to-limit-the-number-of-rows-returned-by-an-sqlite-query.html\">https:\/\/www.withdata.com\/blog\/sqlite\/how-to-limit-the-number-of-rows-returned-by-an-sqlite-query.html<\/a> .<\/p>\n<p>In PostgreSQL: <a href=\"https:\/\/www.withdata.com\/blog\/postgresql\/how-to-limit-the-number-of-rows-returned-by-an-postgresql-query.html\">https:\/\/www.withdata.com\/blog\/postgresql\/how-to-limit-the-number-of-rows-returned-by-an-postgresql-query.html<\/a> .<\/p>\n<p>Some MySQL tools you can try: <a href=\"https:\/\/www.withdata.com\/mysql\/\"> https:\/\/www.withdata.com\/mysql\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In MySQL, you can use &#8220;LIMIT &lt;skip&gt; &lt;count&gt;&#8221;, like this: select * from sometable order by name limit 20,10 In Oracle: https:\/\/www.withdata.com\/blog\/oracle\/how-to-limit-the-number-of-rows-returned-by-an-oracle-query-after-ordering.html . In SQL Server:\u00a0https:\/\/www.withdata.com\/blog\/sql-server\/the-sql-server-equivalent-for-the-mysql-limit.html\u00a0. In DB2:\u00a0https:\/\/www.withdata.com\/blog\/db2\/the-db2-equivalent-for-the-mysql-limit.html\u00a0. In Sqite: https:\/\/www.withdata.com\/blog\/sqlite\/how-to-limit-the-number-of-rows-returned-by-an-sqlite-query.html . In PostgreSQL: https:\/\/www.withdata.com\/blog\/postgresql\/how-to-limit-the-number-of-rows-returned-by-an-postgresql-query.html . Some MySQL tools you can try: https:\/\/www.withdata.com\/mysql\/<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[289,1323],"class_list":["post-2647","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-equivalent-for-the-mysql-limit","tag-mysql"],"_links":{"self":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2647","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/comments?post=2647"}],"version-history":[{"count":6,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2647\/revisions"}],"predecessor-version":[{"id":6436,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/posts\/2647\/revisions\/6436"}],"wp:attachment":[{"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/media?parent=2647"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/categories?post=2647"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.withdata.com\/blog\/wp-json\/wp\/v2\/tags?post=2647"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}