<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sybase数据库技术，数据库恢复专家 &#187; 分页</title>
	<atom:link href="http://www.dbainfo.net/tag/%e5%88%86%e9%a1%b5/feed" rel="self" type="application/rss+xml" />
	<link>https://www.dbainfo.net</link>
	<description>提供Sybase ASE及Sybase SQL Anywhere数据库修复服务，电话：13811580958(微信)，QQ：289965371！We have many years of experience in recovering data from damanged Sybase devices. Contact us by Phone: +86 13811580958 Wechat: 13811580958 Email: 289965371@qq.com</description>
	<lastBuildDate>Sat, 14 Jun 2025 16:28:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Oracle中实现分页的方法</title>
		<link>https://www.dbainfo.net/oracle-split-page-by-rownum.htm</link>
		<comments>https://www.dbainfo.net/oracle-split-page-by-rownum.htm#comments</comments>
		<pubDate>Mon, 31 May 2010 15:03:26 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Oracle]]></category>
		<category><![CDATA[rownum]]></category>
		<category><![CDATA[分页]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=706</guid>
		<description><![CDATA[在oracle中显示分页很简单， 利用两次rownum就实现了。 下面的语句用来返回DBA_OBJECTS表中类型为TABLE的所有记录中的第100行至第200行。 select * from ( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type=&#39;TABLE&#39; ) a &#160;&#160;&#160; where rownum &#60;= 200 ) where rnm &#62; 100 执行结果为： SQL&#62; select * from &#160; 2&#160; ( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type=&#39;TABLE&#39; ) a &#160; 3&#160;&#160;&#160;&#160;&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>在oracle中显示分页很简单， 利用两次rownum就实现了。</p>
<p>下面的语句用来返回DBA_OBJECTS表中类型为TABLE的所有记录中的第100行至第200行。</p>
<blockquote>
<p>select * from<br />
		( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type=&#39;TABLE&#39; ) a<br />
		&nbsp;&nbsp;&nbsp; where rownum &lt;= 200 )<br />
		where rnm &gt; 100</p>
</blockquote>
<p>执行结果为：</p>
<blockquote>
<p>SQL&gt; select * from<br />
		&nbsp; 2&nbsp; ( select rownum rnm, a.* from ( select OBJECT_NAME from DBA_OBJECTS where object_type=&#39;TABLE&#39; ) a<br />
		&nbsp; 3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; where rownum &lt;= 200 )<br />
		&nbsp; 4&nbsp; where rnm &gt; 100<br />
		&nbsp; 5&nbsp; ;<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101 HISTGRM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 102 HIST_HEAD$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 103 DUAL<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 104 PARTOBJ$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 105 PARTCOL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 106 TABPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 107 INDPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 108 SUBPARTCOL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 109 TABSUBPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 110 INDSUBPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 111 TABCOMPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 112 INDCOMPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 113 PARTLOB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 114 LOBFRAG$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 115 LOBCOMPPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 116 DEFSUBPART$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 117 DEFSUBPARTLOB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 118 SYSTEM_PRIVILEGE_MAP<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 119 TABLE_PRIVILEGE_MAP<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 120 STMT_AUDIT_OPTION_MAP<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 121 RESOURCE_MAP<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 122 USER_ASTATUS_MAP<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 123 EXPACT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 124 NOEXP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 125 PROCEDUREJAVA$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 126 PROCEDUREC$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 127 PROCEDUREPLSQL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 128 RESULT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 129 KOTTD$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 130 KOTTB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 131 KOTAD$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 132 KOTMD$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 133 KOTTBX$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 134 KOTADX$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 135 KOPM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 136 VTABLE$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 137 ATEMPTAB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 138 LIBRARY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 139 USER_HISTORY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 140 MIGRATE$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 141 ICOLDEP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 142 OPERATOR$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 143 OPBINDING$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 144 OPANCILLARY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 145 OPARG$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 146 INDTYPES$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 147 INDOP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 148 INDARRAYTYPE$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 149 SECOBJ$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 150 ASSOCIATION$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 151 USTATS$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 152 JAVASNM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 153 SUM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 154 SUMDETAIL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 155 SUMINLINE$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 156 SUMKEY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 157 SUMAGG$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 158 SUMJOIN$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 159 SUMDEP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 160 SUMPRED$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 161 SUMQB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 162 DIM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 163 DIMLEVEL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 164 DIMLEVELKEY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 165 DIMJOINKEY$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 166 DIMATTR$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 167 HIER$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 168 HIERLEVEL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 169 RLS$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 170 RLS_SC$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 171 RLS_GRP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 172 RLS_CTX$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 173 CONTEXT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 174 RULESET$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 175 INDPART_PARAM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 176 OL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 177 OL$HINTS<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 178 OL$NODES<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 179 SQL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 180 SQL$TEXT<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 181 SQLPROF$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 182 SQLPROF$DESC<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 183 SQLPROF$ATTR<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 184 EXPPKGOBJ$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 185 EXPPKGACT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 186 EXPDEPOBJ$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 187 EXPDEPACT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 188 MON_MODS$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 189 MON_MODS_ALL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 190 METAVIEW$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 191 METAFILTER$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 192 METAXSL$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 193 METAXSLPARAM$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 194 METASTYLESHEET<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 195 METASCRIPT$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 196 METASCRIPTFILTER$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 197 METANAMETRANS$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 198 METAPATHMAP$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 199 EXTERNAL_TAB$<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; RNM OBJECT_NAME<br />
		---------- --------------------------------------------------------------------------------------------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200 EXTERNAL_LOCATION$<br />
		已选择100行。<br />
		SQL&gt;</p>
</blockquote>
<p>&nbsp;</p>
<p>总结：在oracle中利用rownum产生伪列真的是太方便了， 尤其利用派生表再加上伪列可以写出很复杂的sql语句来。</p>
<p>比ASE和IQ的实现方式强N倍。 哎，可叹的sybase啊。</p>
<p>&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-<br />
	&mdash;- 本文为andkylee个人原创，请在尊重作者劳动成果的前提下进行转载；<br />
	&mdash;- 转载务必注明原始出处 :<a href="../" target="_blank" title="http://www.dbainfo.net"> http://www.dbainfo.net</a><br />
	&mdash;- 关键字：oracle 分页 rownum<br />
	&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/oracle-split-page-by-rownum.htm">https://www.dbainfo.net/oracle-split-page-by-rownum.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/oracle-split-page-by-rownum.htm">Oracle中实现分页的方法</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011-12-01 -- <a href="https://www.dbainfo.net/oracle11g-tns-12537-and-ora-609-troubleshooting.htm" title="oracle11g报TNS-12537和ORA-609问题的解决">oracle11g报TNS-12537和ORA-609问题的解决</a> (0)</li><li>2011-10-14 -- <a href="https://www.dbainfo.net/history-of-common-databases.htm" title="各数据库的发展历史">各数据库的发展历史</a> (0)</li><li>2011-04-28 -- <a href="https://www.dbainfo.net/oracle-10g-installation-libstdc-all_no_orclihsodbc.htm" title="oracle10g安装过程中Error in invoking target ‘all_no_orcl ihsodbc’ of makefile问题的解决">oracle10g安装过程中Error in invoking target ‘all_no_orcl ihsodbc’ of makefile问题的解决</a> (0)</li><li>2010-12-23 -- <a href="https://www.dbainfo.net/import-datetime-date-to-oracle-from-sybase-ase.htm" title="从sybase向oracle导入时间类型的数据">从sybase向oracle导入时间类型的数据</a> (0)</li><li>2010-10-22 -- <a href="https://www.dbainfo.net/oracle-view-table-physical-storage-size.htm" title="查看Oracle中表所有字段的字节总长度">查看Oracle中表所有字段的字节总长度</a> (0)</li><li>2010-09-28 -- <a href="https://www.dbainfo.net/view-table-column-properties-ddl.htm" title="查看表中列属性的SQL语句">查看表中列属性的SQL语句</a> (0)</li><li>2010-09-17 -- <a href="https://www.dbainfo.net/java-connect-url-for-oracle-db2-sql-sybase-informix-mysql-pgsql.htm" title="java连接数据库Oracle,DB2,SQL Server,Sybase,Informix,MySQL,PostgreSQL">java连接数据库Oracle,DB2,SQL Server,Sybase,Informix,MySQL,PostgreSQL</a> (0)</li><li>2010-08-29 -- <a href="https://www.dbainfo.net/access-sqlserver-from-oracle-by-transgate.htm" title="从oracle内访问sqlserver2005的数据时一个错误">从oracle内访问sqlserver2005的数据时一个错误</a> (0)</li><li>2010-08-10 -- <a href="https://www.dbainfo.net/oracle10g-create-database-manually.htm" title="手动创建oracle 10g数据库的命令语法">手动创建oracle 10g数据库的命令语法</a> (0)</li><li>2010-08-10 -- <a href="https://www.dbainfo.net/oracle10g-create-database-manully-ora-02778.htm" title="手动创建oracle数据库时报错：ORA-02778">手动创建oracle数据库时报错：ORA-02778</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/oracle-split-page-by-rownum.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASE中数据结果集分页功能的三种实现方法</title>
		<link>https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm</link>
		<comments>https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm#comments</comments>
		<pubDate>Mon, 31 May 2010 14:50:16 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[ASE]]></category>
		<category><![CDATA[分页]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=708</guid>
		<description><![CDATA[接上篇的关于MySQL中的分页方法，本篇简单讨论在Sybase ASE中实现数据结果分页的方式。 本篇介绍三种方法。 第一种：利用游标 程序开发人员比较喜欢使用游标，因为游标的&#8220;循环&#8221;遍历方式类似编程语言中的for，while，loop语句的实现方法，写起来比较容易。使用游标一般步骤是：为指定的SQL语句定义一个游标，打开并移动游标，当移动到指定行号的记录行之后，再按照需要提取的行数来取数据。从表面上看解决了提取指 定范围数据的问题；但是在实际应用上，有可能会出现严重的性能问题。建立游标需要耗用一定的系统资源之外；当表内的数据量有上千万甚至到亿级别并且需要取大量的数据结果时，用游标每移动一 次就取这行数据，然后再移动游标，这个过程将是缓慢的。在使用游标的过程中，系统会给相应的表加上共享锁，导致锁竞争而严重影响数据库的性能。 在此不再介绍游标的实现方式，此法比较简单。一个使用游标分页的例子：sp_splitpage_by_cursor.sql 第二种：利用临时表和标志列 在Sybase ASE12.5.3及以后的版本中，我们可以用top关键字来限定只返回结果集的前N行数据。在ASE12.5.3之前的版本中只能用set rowcount N 的方法来&#8220;曲线救国&#8221;了。 对于取结果集的第N行至第N+M行数据的要求，我们考虑利用top来实现的话，比较容易想到的是：执行两次top，再加一次倒序排序。 步骤如下： 　　　　 &#160; &#160;&#160; (1)　select top N+M * from table_name where_clause order by ID ASC &#160;&#160;&#160; --把此结果集派生为表:table_name1 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (2)&#160;&#160; select top M * from table_name1 order by ID&#160; DESC &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; --把此结果集派生为表：table_name2 &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; (3)&#160;&#160; select * from table_name2 order by ID&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>接上篇的关于MySQL中的分页方法，本篇简单讨论在Sybase ASE中实现数据结果分页的方式。</p>
<p>本篇介绍三种方法。</p>
<p><strong>第一种：利用游标</strong></p>
<p>程序开发人员比较喜欢使用游标，因为游标的&ldquo;循环&rdquo;遍历方式类似编程语言中的for，while，loop语句的实现方法，写起来比较容易。使用游标一般步骤是：为指定的SQL语句定义一个游标，打开并移动游标，当移动到指定行号的记录行之后，再按照需要提取的行数来取数据。从表面上看解决了提取指 定范围数据的问题；但是在实际<span class="t_tag">应用</span>上，有可能会出现严重的性能问题。建立游标需要耗用一定的系统资源之外；当表内的数据量有上千万甚至到亿级别并且需要取大量的数据结果时，用游标每移动一 次就取这行数据，然后再移动游标，这个过程将是缓慢的。在使用游标的过程中，系统会给相应的表加上共享锁，导致锁竞争而严重影响数据库的性能。</p>
<p>在此不再介绍游标的实现方式，此法比较简单。一个使用游标分页的例子：<a href="https://www.dbainfo.net/wp-content/uploads/file/sp_splitpage_by_cursor.sql" target="_blank">sp_splitpage_by_cursor.sql</a></p>
<p><strong>第二种：利用临时表和标志列</strong></p>
<p>在Sybase ASE12.5.3及以后的版本中，我们可以用top关键字来限定只返回结果集的前N行数据。在ASE12.5.3之前的版本中只能用set rowcount N 的方法来&ldquo;曲线救国&rdquo;了。</p>
<p>对于取结果集的第N行至第N+M行数据的要求，我们考虑利用top来实现的话，比较容易想到的是：执行两次top，再加一次倒序排序。</p>
<p>步骤如下：</p>
<p>　　　　 &nbsp; &nbsp;&nbsp; (1)　select top N+M * from <strong>table_name</strong> <em>where_clause</em> <span style="text-decoration: underline;">order by ID ASC</span> &nbsp;&nbsp;&nbsp; --把此结果集派生为表:table_name1</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)&nbsp;&nbsp; select top M * from<strong> table_name1</strong> <span style="text-decoration: underline;">order by ID&nbsp; DESC</span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --把此结果集派生为表：table_name2</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (3)&nbsp;&nbsp; select * from <strong>table_name2</strong> <span style="text-decoration: underline;">order by ID&nbsp; ASC</span></p>
<p>上面的3条语句好像能够实现返回第N行至第N+M行数据的要求。但是，在Sybase ASE中仅仅利用派生表而不利用临时表是不能实现这个要求的。</p>
<p>仅仅是ASE中的&ldquo;派生出派生表(derived table)的SQL语句中不能含有order by 子句&rdquo;这个限制就足以使上面的方法行不通。还有一个限制是，上面的3个步骤中都利用ID列进行排序。如果表中没有可用的排序列时，那么上述方法也不能用 了。不过幸运的是，一般要求对其结果集进行分页的表都是有可以用作排序的列的（数字型或者日期型）。</p>
<p>继续寻找一个能用的方法，下面着重介绍目前通用的ASE的分页思路。此思路的关键是产生identity自增列和临时表。</p>
<p>在ASE中大家要是找到了不用临时表就可以实现分页的方法请麻烦告诉我一声。 我尝试了很多次，都不是很理想。</p>
<p>概括起来主要语句有两条：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (1)&nbsp;&nbsp; select syb=identity(10),*&nbsp; into <em>#temp_table </em> from <em>table_name</em> <strong>where_clause</strong> &nbsp; <strong>order_by_clause</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)&nbsp;&nbsp; select&nbsp; * from <em>#temp_table </em> <strong>where_clause </strong> and syb &gt;= <strong>N</strong> &nbsp; and syb &lt;= <strong>N+M</strong></p>
<p>使用此方法实现ASE分页的一个存储过程为：</p>
<blockquote>
<p>-- 此存储过程适用于所有版本的ASE中<br />
		use sybsystemprocs<br />
		go<br />
		if exists(select 1 from sybsystemprocs.dbo.sysobjects where type=&#39;P&#39; and name=&#39;sp_page&#39;)<br />
		&nbsp; drop procedure sp_page<br />
		go</p>
<p>		create procedure sp_page @qry varchar(16384),@ipage int,@num int <br />
		as<br />
		begin<br />
		&nbsp; <br />
		&nbsp; declare @rcount int<br />
		&nbsp; declare @execsql varchar(16384)<br />
		&nbsp; <br />
		&nbsp; select @rcount=@ipage*@num<br />
		&nbsp; set @execsql = &#39;set rowcount &#39;|| convert(varchar,@rcount)<br />
		&nbsp; set @execsql = @execsql || stuff(@qry,charindex(&#39;SELECT &#39;,upper(@qry)),6,&#39; SELECT sybid=identity(12),&#39;)<br />
		&nbsp; set @execsql = stuff(@execsql,charindex(&#39; FROM &#39;,upper(@execsql)),6,&#39; INTO #temptable FROM &#39;)<br />
		&nbsp; set @execsql = @execsql || &#39; SELECT * FROM #temptable&nbsp; WHERE sybid &gt;&#39; || convert(varchar,(@ipage-1)*@num)<br />
		&nbsp; set @execsql = @execsql || &#39; AND sybid&lt;=&#39; || convert(varchar,@ipage*@num) + &#39; set rowcount 0&#39;<br />
		&nbsp; execute(@execsql)<br />
		&nbsp; <br />
		end<br />
		go</p>
<p>		exec sp_procxmode &#39;sp_page&#39;,anymode<br />
		go<br />
		grant execute on sp_page to public<br />
		go</p>
</blockquote>
<p>用一个例子演示一下：</p>
<p>(1) 建立测试表:testA</p>
<blockquote>
<p>create table testA(id int not null,name varchar(30) null)<br />
		go</p>
</blockquote>
<p>(2) 插入测试数据</p>
<blockquote>
<p>insert into testA<br />
		select 1,&#39;liuzhenfu&#39;<br />
		go<br />
		insert into testA<br />
		select 2,&#39;andkylee&#39;<br />
		go</p>
</blockquote>
<p>(3) 循环插入大量的重复数据</p>
<blockquote>
<p>insert into testA<br />
		select id+(select max(id) from testA),name from testA<br />
		go 15</p>
</blockquote>
<p>向表testA循环插入已有的数据，15次之后，表testA内的数据达到2^16 = 65536 行。</p>
<p>&nbsp;</p>
<p>(4) 利用临时表 + 自增标志列来提取第100行至第200行的数据。</p>
<p>语句如下：</p>
<blockquote>
<p>select syb=identity(10) ,* into #tempA from testA<br />
		select * from #tempA where syb&gt;=100 and syb&lt;=200<br />
		drop table #tempA</p>
</blockquote>
<p>返回的结果为：</p>
<blockquote>
<p>1&gt; select syb=identity(10),* into #tempA from testA<br />
		2&gt; select * from #tempA where syb&gt;=100 and syb&lt;=200<br />
		3&gt; go<br />
		(65536 rows affected)<br />
		&nbsp;syb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;------------- ----------- ---------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 100 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 101 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 102 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 103&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 103 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 104 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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bsp;&nbsp;&nbsp;&nbsp;&nbsp; 196 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 197 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 198 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 199&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 199 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 200 andkylee<br />
		(101 rows affected)</p>
</blockquote>
<p>需要将select * from #tempA中的星号*替换为需要返回的列名。</p>
<p>继续。。。。</p>
<p>当要求返回满足name=&#39;andkylee&#39;的所有行中的第100行至第200行的数据时， 利用</p>
<blockquote>
<p>select syb=identity(10),* into #tempA from testA where name=&#39;andkylee&#39;</p>
<p>		select * from #tempA where syb&gt;=100 and syb&lt;=200</p>
<p>		drop table #tempA</p>
</blockquote>
<p>&nbsp;</p>
<p><strong>第三种：利用rowcount</strong></p>
<p>此种方法有点不足：必须利用<strong>可用作排序的列</strong> 对结果集进行排序。</p>
<p>还是上面的测试表testA，如果从第9000行开始选择10行数据，那么语句如下：</p>
<blockquote>
<p>declare @id1 int<br />
		set rowcount 9000<br />
		select @id1 = id from testA order by id<br />
		set rowcount 10<br />
		select *from testA where id &gt;= @id1 order by id<br />
		set rowcount 0<br />
		go</p>
</blockquote>
<p>&nbsp;</p>
<p>此种方法中核心语句是select @id1=id from testA order by id ， 在对表testA执行查询的过程中，每读取一行都会把id列的值赋给@id1这个变量，一直持续到最后一行，@id1这个变量反复被下一行的id值刷新， 最后结果只得到最后一行的id值。如果在此select语句之前加上rowcount的限定，那么就可用变量@id1来获得第rowcount行的id 值，于是我们也就获得了要返回的范围结果集的起点了。</p>
<p>后面的 set rowcount 10</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; select * from testA where id &gt;= @id1 order by id</p>
<p>这两句实际上可以用一句select top 10 * from testA where id &gt;= @id1 order by id&nbsp; 来替代。&nbsp;</p>
<p>这样，两种不同的实现形式为:</p>
<blockquote>
<p>declare @id1 int<br />
		set rowcount 9000<br />
		select @id1 = id from testA&nbsp; order by id<br />
		set rowcount 0<br />
		select top 10&nbsp; *from testA where&nbsp; id &gt;= @id1 order by id<br />
		go</p>
</blockquote>
<p>&nbsp;</p>
<p>分别看看执行结果吧！</p>
<p>第一种方式的执行结果：</p>
<blockquote>
<p>1&gt; declare @id1 int<br />
		2&gt; set rowcount 9000<br />
		3&gt; select @id1 = id from testA order by id<br />
		4&gt; set rowcount 10<br />
		5&gt; select *from testA where id &gt;= @id1 order by id<br />
		6&gt; set rowcount 0<br />
		7&gt; go<br />
		(9000 rows affected)<br />
		&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;----------- ------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9000 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9001 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9002 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9003 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9004 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9005 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9006 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9007 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9008 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9009 liuzhenfu<br />
		(10 rows affected)<br />
		1&gt;<br />
		&nbsp;</p>
</blockquote>
<p>第二种方式的执行结果：</p>
<blockquote>
<p>1&gt; declare @id1 int<br />
		2&gt; set rowcount 9000<br />
		3&gt; select @id1 = id from testA order by id<br />
		4&gt; set rowcount 0<br />
		5&gt; select top 10&nbsp; *from testA where id &gt;= @id1 order by id<br />
		6&gt; go<br />
		(9000 rows affected)<br />
		&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;----------- ------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9000 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9001 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9002 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9003 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9004 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9005 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9006 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9007 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9008 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 9009 liuzhenfu<br />
		(10 rows affected)<br />
		1&gt;</p>
</blockquote>
<p>当然，两种结果一模一样。</p>
<p><strong>最后我们测试表testA中的ID列顺序值打乱， 来看看以上语句的执行情况。</strong>执行：</p>
<blockquote>
<p>update testA set id = id + cast( rand() * 65536 as int )&nbsp;</p>
</blockquote>
<p>ID列值打乱之后，前100行的数据为：</p>
<blockquote>
<p>1&gt; select top 100 * from testA<br />
		2&gt; go<br />
		&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;----------- ------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 51366 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 33573 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19447 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19408 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 57839 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 18817 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp; ......................<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 19075 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 17081 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 26444 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6620 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 52344 liuzhenfu<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 49348 andkylee<br />
		(100 rows affected)</p>
</blockquote>
<p>我们要求返回满足name=&#39;andkylee&#39;的从第9000行开始的10行数据。</p>
<blockquote>
<p>declare @id1 int<br />
		set rowcount 9000<br />
		select @id1 = id from testA where name=&#39;andkylee&#39; order by id<br />
		set rowcount 10<br />
		select *from testA where name=&#39;andkylee&#39; and id &gt;= @id1 order by id<br />
		set rowcount 0<br />
		go</p>
</blockquote>
<p>结果为：</p>
<blockquote>
<p>1&gt; declare @id1 int<br />
		2&gt; set rowcount 9000<br />
		3&gt; select @id1 = id from testA where name=&#39;andkylee&#39; order by id<br />
		4&gt; set rowcount 10<br />
		5&gt; select *from testA where name=&#39;andkylee&#39; and id &gt;= @id1 order by id<br />
		6&gt; set rowcount 0<br />
		7&gt; go<br />
		(9000 rows affected)<br />
		&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;----------- ------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48639 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48639 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48641 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48641 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48642 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48643 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48644 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48644 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48650 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 48650 andkylee<br />
		(10 rows affected)</p>
</blockquote>
<p>如果不对ID列进行排序， 有下面的sql语句：</p>
<blockquote>
<p>declare @id1 int<br />
		set rowcount 9000<br />
		select @id1 = id from testA where name=&#39;andkylee&#39;<br />
		set rowcount 10<br />
		select *from testA where name=&#39;andkylee&#39; and id &gt;= @id1 <br />
		set rowcount 0<br />
		go</p>
</blockquote>
<p>相应的结果集为：</p>
<blockquote>
<p>1&gt; declare @id1 int<br />
		2&gt; set rowcount 9000<br />
		3&gt; select @id1 = id from testA where name=&#39;andkylee&#39;<br />
		4&gt; set rowcount 10<br />
		5&gt; select *from testA where name=&#39;andkylee&#39; and id &gt;= @id1<br />
		6&gt; set rowcount 0<br />
		7&gt; go<br />
		(9000 rows affected)<br />
		&nbsp;id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name<br />
		&nbsp;----------- ------------------------------<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74076 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74514 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74053 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74385 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74339 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74792 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74794 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74984 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 75052 andkylee<br />
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74138 andkylee<br />
		(10 rows affected)<br />
		1&gt;</p>
</blockquote>
<p>可以发现这个两句的结果是不同的。</p>
<p>我想既然都要求返回指定范围的结果集， 肯定是有排序的依据了， 否则怎么知道该返回哪个范围呢？</p>
<p>还有，我给出的第三种方法，在进行表扫描的时候，即使不指定排序，也是能够得到正确结果的。因为表扫描时很可能会按照表内数据在物理页面上的物理位置来返回结果。</p>
<p>就先介绍到这里吧， 后续可能会根据情况进行补充。</p>
<p><strong>文件下载：<br />
	</strong></p>
<p>使用第二种方法在ASE实现分页的存储过程： <a href="https://www.dbainfo.net/wp-content/uploads/file/sp_page.sql" target="_blank">sp_page.sql</a> 包含top和set rowcount两种。</p>
<p>根据显示的当前页号进行优化处理、更通用些的存储过程：<a href="https://www.dbainfo.net/wp-content/uploads/file/splitpage.sql" target="_blank">splitpage.sql</a></p>
<p>&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-<br />
	&mdash;- 本文为andkylee个人原创，请在尊重作者劳动成果的前提下进行转载；<br />
	&mdash;- 转载务必注明原始出处 :<a href="../" target="_blank" title="http://www.dbainfo.net"> http://www.dbainfo.net</a><br />
	&mdash;- 关键字：ASE 分页&nbsp; top&nbsp; identity&nbsp; set rowcount&nbsp; temp table&nbsp; 自增列 伪列 临时表<br />
	&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm">https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm">ASE中数据结果集分页功能的三种实现方法</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2019-04-12 -- <a href="https://www.dbainfo.net/sybase-ase-asa-recovery-service.htm" title="Sybase ASE及SQL Anywhere数据库修复专家">Sybase ASE及SQL Anywhere数据库修复专家</a> (0)</li><li>2015-01-16 -- <a href="https://www.dbainfo.net/one-way-to-recover-master-configuration-area.htm" title="master数据库配置区域(configuration area)损坏的一种修复方法">master数据库配置区域(configuration area)损坏的一种修复方法</a> (1)</li><li>2014-10-10 -- <a href="https://www.dbainfo.net/ase-object-name-length-limit.htm" title="ASE对象名称长度限制">ASE对象名称长度限制</a> (0)</li><li>2014-06-09 -- <a href="https://www.dbainfo.net/count_all_tables_rowcount.htm" title="统计用户数据库内所有表的行数">统计用户数据库内所有表的行数</a> (0)</li><li>2013-11-19 -- <a href="https://www.dbainfo.net/showplan_html_format.htm" title="以HTML格式显示ASE查询计划">以HTML格式显示ASE查询计划</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation5.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 5、安装后的配置工作">Sybase ASE 15.0.3 for windows平台安装文档 – 5、安装后的配置工作</a> (1)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation4.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 4、安装Sybase数据库服务">Sybase ASE 15.0.3 for windows平台安装文档 – 4、安装Sybase数据库服务</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation3.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 3、升级到 Sybase 15.0.3 ESD #3">Sybase ASE 15.0.3 for windows平台安装文档 – 3、升级到 Sybase 15.0.3 ESD #3</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation2.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 2、安装Sybase ASE程序">Sybase ASE 15.0.3 for windows平台安装文档 – 2、安装Sybase ASE程序</a> (0)</li><li>2013-11-11 -- <a href="https://www.dbainfo.net/ase-15-0-3-for-windows-installation1.htm" title="Sybase ASE 15.0.3 for windows平台安装文档 – 1、安装前的准备工作">Sybase ASE 15.0.3 for windows平台安装文档 – 1、安装前的准备工作</a> (1)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL中数据结果集分页功能的实现方法</title>
		<link>https://www.dbainfo.net/mysql-split-page-ways.htm</link>
		<comments>https://www.dbainfo.net/mysql-split-page-ways.htm#comments</comments>
		<pubDate>Mon, 31 May 2010 11:46:10 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[分页]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=711</guid>
		<description><![CDATA[目前B/S架构的软件大行其道。通过浏览器如何向终端用户只展示指定页面内容而不是全部的？毕竟返回全部结果集，时间和空间开销都很大。 如此情况下，对SQL返回结果集进行分页是个很不错的解决方案。 本文主要介绍MySQL数据库中的分页实现方式。我以一个数据库管理员的角度进行说明，至于具体的实现还需要开发人员详细编写过程。 总的说来，在MySQL中实现分页功能是很简单的事情。MySQL数据库的开发人员替广大的使用者着想，提供了一个关键字limit来实现限定指定范围的功能。 下面简单介绍分页的思路。 在MySQL5.0.15-nt-max下进行测试。 1.新建一张临时表(MyISAM或者InnoDB类型的都可以)，本测试表没有使用自增列。 CREATE TABLE `andkylee` ( &#160; `id` int(11) NOT NULL, &#160; `name` varchar(30) default NULL, &#160; `sex` char(1) NOT NULL, &#160; `age` smallint(6) default NULL, &#160; `note` varchar(100) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8; &#160; 2.插入测试数据。 在这里尤其介绍一种插入大量测试数据的方法。 先插入2条数据： insert into andkylee values(1,&#39;hanyuliu&#39;,&#39;F&#39;,25,&#39;aaaaaaaaaa&#39;),(2,&#39;andkylee&#39;,&#39;F&#39;,33,&#39;bbbbbbbbbb&#39;); &#160; 批量插入数据： 在没有自增列的情况下，用下面的语句来实现插入&#8220;重复&#8221;数据。 insert into andkylee select [...]]]></description>
			<content:encoded><![CDATA[<p>目前B/S架构的软件大行其道。通过浏览器如何向终端用户只展示指定页面内容而不是全部的？毕竟返回全部结果集，时间和空间开销都很大。</p>
<p>如此情况下，对SQL返回结果集进行分页是个很不错的解决方案。</p>
<p>本文主要介绍MySQL数据库中的分页实现方式。我以一个数据库管理员的角度进行说明，至于具体的实现还需要开发人员详细编写过程。</p>
<p>总的说来，在MySQL中实现分页功能是很简单的事情。MySQL数据库的开发人员替广大的使用者着想，提供了一个关键字limit来实现限定指定范围的功能。</p>
<p>下面简单介绍分页的思路。</p>
<p>在MySQL5.0.15-nt-max下进行测试。</p>
<p>1.新建一张临时表(MyISAM或者InnoDB类型的都可以)，本测试表没有使用自增列。</p>
<blockquote>
<p>CREATE TABLE `andkylee` (<br />
		&nbsp; `id` int(11) NOT NULL,<br />
		&nbsp; `name` varchar(30) default NULL,<br />
		&nbsp; `sex` char(1) NOT NULL,<br />
		&nbsp; `age` smallint(6) default NULL,<br />
		&nbsp; `note` varchar(100) default NULL<br />
		) ENGINE=MyISAM DEFAULT CHARSET=utf8;</p>
</blockquote>
<p>&nbsp;</p>
<p>2.插入测试数据。 在这里尤其介绍一种插入大量测试数据的方法。</p>
<p>	先插入2条数据：</p>
<blockquote>
<p>insert into andkylee<br />
		values(1,&#39;hanyuliu&#39;,&#39;F&#39;,25,&#39;aaaaaaaaaa&#39;),(2,&#39;andkylee&#39;,&#39;F&#39;,33,&#39;bbbbbbbbbb&#39;);</p>
</blockquote>
<p>&nbsp;</p>
<p>批量插入数据：</p>
<p>在没有自增列的情况下，用下面的语句来实现插入&ldquo;重复&rdquo;数据。</p>
<p>insert into andkylee<br />
	select id+(select max(id) from andkylee),name,sex,age,note from andkylee;</p>
<p>&nbsp;</p>
<p>本语句能够复制表已有的所有记录，并且能够实现&ldquo;主键列&rdquo;自增。</p>
<p>可能有点缺陷的是：需要再select列表中逐个写出各个列名。但是，好像含有自增列的表为了实现插入重复数据，也必须把非自增列都写出来吧。 如果我说的不对，请告知。</p>
<p>循环插入重复数据，使得表数据行数以指数方式增长。 再把已有的数据插入到表内，行数变为以前的2倍。</p>
<p>insert into andkylee<br />
	select id+(select max(id) from andkylee),name,sex,age,note from andkylee;</p>
<p>&nbsp;</p>
<blockquote>
<p>mysql&gt; select count(*) from andkylee;<br />
		+----------+<br />
		| count(*) |<br />
		+----------+<br />
		|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4 |<br />
		+----------+<br />
		1 row in set (0.05 sec)</p>
</blockquote>
<p>重复上面的语句，执行10次之后，表内的数据行数为：2048</p>
<p>测试数据情况为：</p>
<blockquote>
<p>mysql&gt; select *from andkylee;<br />
		+------+----------+-----+------+------------+<br />
		| id&nbsp;&nbsp; | name&nbsp;&nbsp;&nbsp;&nbsp; | sex | age&nbsp; | note&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
		+------+----------+-----+------+------------+<br />
		|&nbsp;&nbsp;&nbsp; 1 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		|&nbsp;&nbsp;&nbsp; 2 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		|&nbsp;&nbsp;&nbsp; 3 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		|&nbsp;&nbsp;&nbsp; 4 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		.....<br />
		| 2043 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 2044 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 2045 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 2046 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 2047 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 2048 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		+------+----------+-----+------+------------+<br />
		2048 rows in set (0.08 sec)<br />
		&nbsp;</p>
</blockquote>
<p>3.选择第100至300行数据</p>
<p>	这里不得不介绍limit这个关键字了。</p>
<p>	limit关键字的使用方式为：</p>
<p>	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong> (SQL statement)&nbsp; limit row_position,row_count</strong></p>
<p>	其中：(SQL statement) 为完整的SQL语句，就是普通的sql语句，以前的语句该怎么写的还是怎么写。</p>
<p>	limit 是个关键字，在MySQL中关键字是不区分大小写的，Limit,limit,LIMIT对于数据库引擎来说都是一样的。</p>
<p>	后面是两个参数，row_position表示起始行，更确切的说应该是偏移行，自然row_position是从0开始的。也就是说第一行的偏移行数为0.</p>
<p>	要是想返回从第二行开始的记录，就将row_position指定为1.</p>
<p>	第二个参数：row_count表示返回的行数。 这个很简单，不赘述。</p>
<p>	因此，要返回第100至300行数据，需要指定偏移行号为99，并且行数为201.</p>
<p>	语句为：</p>
<blockquote>
<p>select *from andkylee LimiT 99,201;</p>
</blockquote>
<p>返回结果为：</p>
<blockquote>
<p>mysql&gt; select *from andkylee LimiT 99,201;<br />
		+-----+----------+-----+------+------------+<br />
		| id&nbsp; | name&nbsp;&nbsp;&nbsp;&nbsp; | sex | age&nbsp; | note&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
		+-----+----------+-----+------+------------+<br />
		| 100 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 101 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 102 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 103 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 104 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 105 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 106 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 107 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 108 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 109 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 110 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 111 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 112 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 113 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 114 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 115 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 116 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 117 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 118 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 119 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 120 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 121 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 122 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 123 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 124 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 125 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 126 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 127 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 128 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 129 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 130 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 131 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 132 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 133 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 134 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 135 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 136 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 137 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 138 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 139 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 140 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 141 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 142 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 143 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 144 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 145 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 146 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 147 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 148 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 149 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 150 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 151 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 152 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 153 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 154 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 155 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 156 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 157 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 158 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 159 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 160 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 161 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 162 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 163 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 164 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 165 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 166 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 167 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 168 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 169 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 170 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 171 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 172 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 173 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 174 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 175 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 176 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 177 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 178 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 179 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 180 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 181 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 182 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 183 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 184 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 185 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 186 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 187 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 188 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 189 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 190 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 191 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 192 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 193 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 194 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 195 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 196 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 197 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 198 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 199 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 200 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 201 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 202 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 203 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 204 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 205 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 206 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 207 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 208 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 209 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 210 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 211 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 212 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 213 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 214 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 215 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 216 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 217 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 218 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 219 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 220 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 221 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 222 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 223 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 224 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 225 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 226 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 227 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 228 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 229 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 230 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 231 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 232 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 233 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 234 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 235 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 236 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 237 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 238 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 239 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 240 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 241 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 242 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 243 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 244 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 245 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 246 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 247 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 248 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 249 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 250 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 251 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 252 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 253 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 254 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 255 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 256 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 257 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 258 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 259 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 260 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 261 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 262 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 263 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 264 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 265 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 266 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 267 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 268 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 269 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 270 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 271 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 272 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 273 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 274 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 275 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 276 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 277 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 278 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 279 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 280 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 281 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 282 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 283 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 284 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 285 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 286 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 287 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 288 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 289 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 290 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 291 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 292 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 293 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 294 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 295 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 296 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 297 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 298 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 299 | hanyuliu | F&nbsp;&nbsp; |&nbsp;&nbsp; 25 | aaaaaaaaaa |<br />
		| 300 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		+-----+----------+-----+------+------------+<br />
		201 rows in set (0.00 sec)<br />
		mysql&gt;</p>
</blockquote>
<p>&nbsp;</p>
<p>再展示一个带where条件的语句的limit使用情况。</p>
<p>返回name为&#39;andkylee&#39;的所有记录的第100至300行数据。</p>
<blockquote>
<p>select *from andkylee where name=&#39;andkylee&#39; LimiT 99,201;</p>
</blockquote>
<p>结果为：</p>
<blockquote>
<p>mysql&gt; select *from andkylee where name=&#39;andkylee&#39; LimiT 99,201;<br />
		+-----+----------+-----+------+------------+<br />
		| id&nbsp; | name&nbsp;&nbsp;&nbsp;&nbsp; | sex | age&nbsp; | note&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br />
		+-----+----------+-----+------+------------+<br />
		| 200 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 202 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 204 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 206 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 208 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 210 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 212 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 214 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 216 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 218 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 220 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 222 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 224 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 226 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 228 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 230 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 232 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 234 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 236 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 238 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 240 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 242 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 244 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 246 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 248 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 250 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 252 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 254 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 256 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 258 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 260 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 262 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 264 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 266 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 268 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 270 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 272 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 274 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 276 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 278 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 280 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 282 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 284 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 286 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 288 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 290 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 292 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 294 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 296 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 298 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 300 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 302 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 304 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 306 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 308 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 310 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 312 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 314 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 316 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 318 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 320 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 322 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 324 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 326 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 328 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 330 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 332 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 334 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 336 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 338 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 340 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 342 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 344 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 346 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 348 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 350 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 352 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 354 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 356 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 358 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 360 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 362 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 364 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 366 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 368 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 370 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 372 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 374 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 376 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 378 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 380 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 382 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 384 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 386 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 388 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 390 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 392 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 394 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 396 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 398 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 400 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 402 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 404 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 406 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 408 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 410 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 412 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 414 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 416 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 418 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 420 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 422 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 424 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 426 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 428 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 430 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 432 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 434 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 436 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 438 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 440 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 442 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 444 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 446 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 448 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 450 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 452 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 454 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 456 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 458 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 460 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 462 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 464 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 466 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 468 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 470 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 472 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 474 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 476 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 478 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 480 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 482 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 484 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 486 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 488 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 490 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 492 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 494 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 496 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 498 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 500 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 502 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 504 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 506 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 508 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 510 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 512 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 514 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 516 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 518 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 520 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 522 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 524 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 526 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 528 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 530 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 532 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 534 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 536 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 538 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 540 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 542 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 544 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 546 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 548 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 550 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 552 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 554 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 556 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 558 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 560 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 562 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 564 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 566 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 568 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 570 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 572 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 574 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 576 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 578 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 580 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 582 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 584 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 586 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 588 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 590 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 592 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 594 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 596 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 598 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		| 600 | andkylee | F&nbsp;&nbsp; |&nbsp;&nbsp; 33 | bbbbbbbbbb |<br />
		+-----+----------+-----+------+------------+<br />
		201 rows in set (0.09 sec)<br />
		mysql&gt;</p>
</blockquote>
<p>&nbsp;</p>
<p>4. 功能完善。</p>
<p>	通过第3步骤中的两个结果集进行对比，我们可以发现，MySQL中的limit关键字类似于一个伪列的功能。比oracle中的rownum要强大，在oracle中要通过一次rownum再加一次虚拟列才能实现类似MySQL中的limit功能。因此limit功能存在优势的地方在于：不产生虚拟列。也就是说你不需要花费额外的功夫来处理列名列表了。最简单的就是直接用星号*,开发人员在编写存错过程的时候比较省事了。</p>
<p>	最后，个人感觉：通过比较mssqlserver，oracle，sybase中的分页是实现方式，我感觉MySQL的limit是最简单最方便的。</p>
<p>&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-<br />
	&mdash;- 本文为andkylee个人原创，请在尊重作者劳动成果的前提下进行转载；<br />
	&mdash;- 转载务必注明原始出处 :<a href="../" target="_blank" title="http://www.dbainfo.net"> http://www.dbainfo.net</a><br />
	&mdash;- 关键字：MySQL 分页&nbsp; limit<br />
	&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;&mdash;-</p>
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/mysql-split-page-ways.htm">https://www.dbainfo.net/mysql-split-page-ways.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/mysql-split-page-ways.htm">MySQL中数据结果集分页功能的实现方法</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2011-10-14 -- <a href="https://www.dbainfo.net/history-of-common-databases.htm" title="各数据库的发展历史">各数据库的发展历史</a> (0)</li><li>2010-09-17 -- <a href="https://www.dbainfo.net/java-connect-url-for-oracle-db2-sql-sybase-informix-mysql-pgsql.htm" title="java连接数据库Oracle,DB2,SQL Server,Sybase,Informix,MySQL,PostgreSQL">java连接数据库Oracle,DB2,SQL Server,Sybase,Informix,MySQL,PostgreSQL</a> (0)</li><li>2010-05-31 -- <a href="https://www.dbainfo.net/oracle-split-page-by-rownum.htm" title="Oracle中实现分页的方法">Oracle中实现分页的方法</a> (0)</li><li>2010-05-31 -- <a href="https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm" title="ASE中数据结果集分页功能的三种实现方法">ASE中数据结果集分页功能的三种实现方法</a> (0)</li><li>2010-02-05 -- <a href="https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm" title="三种SQL分页法[转帖]">三种SQL分页法[转帖]</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/mysql-split-page-ways.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>三种SQL分页法[转帖]</title>
		<link>https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm</link>
		<comments>https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm#comments</comments>
		<pubDate>Fri, 05 Feb 2010 05:31:39 +0000</pubDate>
		<dc:creator>dbainfo</dc:creator>
				<category><![CDATA[Sybase ASE]]></category>
		<category><![CDATA[分页]]></category>

		<guid isPermaLink="false">http://www.dbainfo.net/?p=127</guid>
		<description><![CDATA[应一个朋友的要求，贴上收藏的SQL常用分页的办法～～ 表中主键必须为标识列，[ID] int IDENTITY (1,1) 1.分页方案一：(利用Not In和SELECT TOP分页) 语句形式：  SELECT TOP 页记录数量 * FROM 表名 WHERE (ID NOT IN   (SELECT TOP (每页行数*(页数-1)) ID   FROM 表名   ORDER BY ID))   ORDER BY ID //自己还可以加上一些查询条件 例: select top 2 * from Sys_Material_Type where (MT_ID not in     (select top (2*(3-1)) MT_ID from Sys_Material_Type  [...]]]></description>
			<content:encoded><![CDATA[<p>应一个朋友的要求，贴上收藏的SQL常用分页的办法～～</p>
<p>表中主键必须为标识列，[ID] int IDENTITY (1,1)</p>
<p>1.分页方案一：(利用Not In和SELECT TOP分页)</p>
<p>语句形式： <br />
SELECT TOP 页记录数量 *<br />
FROM 表名<br />
WHERE (ID NOT IN<br />
  (SELECT TOP (每页行数*(页数-1)) ID<br />
  FROM 表名<br />
  ORDER BY ID))<br />
  ORDER BY ID<br />
//自己还可以加上一些查询条件</p>
<p>例:<br />
select top 2 *<br />
from Sys_Material_Type<br />
where (MT_ID not in<br />
    (select top (2*(3-1)) MT_ID from Sys_Material_Type  order by MT_ID))<br />
order by MT_ID</p>
<p>2.分页方案二：(利用ID大于多少和SELECT TOP分页）</p>
<p>语句形式：<br />
SELECT TOP 每页记录数量 *<br />
FROM 表名<br />
WHERE (ID &gt;<br />
          (SELECT MAX(id)<br />
    FROM (SELECT TOP 每页行数*页数 id  FROM 表<br />
          ORDER BY id) AS T)<br />
      )<br />
ORDER BY ID</p>
<p>例:<br />
SELECT TOP 2 *<br />
FROM Sys_Material_Type<br />
WHERE (MT_ID &gt;<br />
          (SELECT MAX(MT_ID)<br />
          FROM (SELECT TOP (2*(3-1)) MT_ID<br />
                FROM Sys_Material_Type<br />
                ORDER BY MT_ID) AS T))<br />
ORDER BY MT_ID</p>
<p>3.分页方案三：(利用SQL的游标存储过程分页)<br />
create  procedure SqlPager<br />
@sqlstr nvarchar(4000), --查询字符串<br />
@currentpage int, --第N页<br />
@pagesize int --每页行数<br />
as<br />
set nocount on<br />
declare @P1 int, --P1是游标的id<br />
@rowcount int<br />
exec sp_cursoropen @P1 output,@sqlstr,@scrollopt=1,@ccopt=1, @rowcount=@rowcount output<br />
select ceiling(1.0*@rowcount/@pagesize) as 总页数--,@rowcount as 总行数,@currentpage as 当前页<br />
set @currentpage=(@currentpage-1)*@pagesize+1<br />
exec sp_cursorfetch @P1,16,@currentpage,@pagesize<br />
exec sp_cursorclose @P1<br />
set nocount off</p>
<p>4.总结:<br />
其它的方案：如果没有主键，可以用临时表，也可以用方案三做，但是效率会低。<br />
建议优化的时候，加上主键和索引，查询效率会提高。</p>
<p>通过SQL 查询分析器，显示比较：我的结论是:<br />
分页方案二：(利用ID大于多少和SELECT TOP分页）效率最高，需要拼接SQL语句<br />
分页方案一：(利用Not In和SELECT TOP分页)  效率次之，需要拼接SQL语句<br />
分页方案三：(利用SQL的游标存储过程分页)    效率最差，但是最为通用
<div style="clear: both; margin: 10px 0pt; border: 1px dashed rgb(153, 153, 153); font-size: 12px; padding: 5px 10px;">
<li>本文链接地址：<a href="https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm">https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm</a>；</li>
<li>本文为dbainfo个人原创，请在尊重作者劳动成果的前提下进行转载；</li>
<li>转载务必注明原始出处 : <a href="https://www.dbainfo.net/">Sybase数据库技术，数据库恢复专家</a>；</li>
<li>对《<a href="https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm">三种SQL分页法[转帖]</a>》有何疑问或见解，请在本文下方发表；</li>
<li>对网站还有其他问题或建议，请提交在<a href="https://www.dbainfo.net/messages" target="_blank">留言板</a>，谢谢！</li>
</div>
<h2  class="related_post_title">相关文章</h2><ul class="related_post"><li>2010-05-31 -- <a href="https://www.dbainfo.net/oracle-split-page-by-rownum.htm" title="Oracle中实现分页的方法">Oracle中实现分页的方法</a> (0)</li><li>2010-05-31 -- <a href="https://www.dbainfo.net/ase-split-page-3ways-identity-setrowcount-temptable.htm" title="ASE中数据结果集分页功能的三种实现方法">ASE中数据结果集分页功能的三种实现方法</a> (0)</li><li>2010-05-31 -- <a href="https://www.dbainfo.net/mysql-split-page-ways.htm" title="MySQL中数据结果集分页功能的实现方法">MySQL中数据结果集分页功能的实现方法</a> (0)</li></ul>]]></content:encoded>
			<wfw:commentRss>https://www.dbainfo.net/display-sql-results-page-by-page-3ways.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
