<?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>DreamIdea &#187; Oracle</title>
	<atom:link href="http://www.dreamidea.net/tag/oracle/feed" rel="self" type="application/rss+xml" />
	<link>http://www.dreamidea.net</link>
	<description></description>
	<lastBuildDate>Tue, 12 Apr 2011 13:58:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Oracle查询指定记录数的奇怪问题</title>
		<link>http://www.dreamidea.net/back-end/database/oracle_query_count_problem</link>
		<comments>http://www.dreamidea.net/back-end/database/oracle_query_count_problem#comments</comments>
		<pubDate>Fri, 25 Dec 2009 02:39:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Rac]]></category>

		<guid isPermaLink="false">http://www.dreamidea.net/?p=34</guid>
		<description><![CDATA[<a href="http://www.dreamidea.net/back-end/database/oracle_query_count_problem" title="Oracle查询指定记录数的奇怪问题"></a>首先看一段代码： 环境1：windows + oracle 10g 正常 环境2: Redhat E5.2 64bit + oracle 10g(RAC集群) 查询执行，但是返回记录数只有10条，不管你的count有多大。 改成 则都能正常查询记录。 此问题比较奇怪有问题再研究研究。]]></description>
			<content:encoded><![CDATA[<a href="http://www.dreamidea.net/back-end/database/oracle_query_count_problem" title="Oracle查询指定记录数的奇怪问题"></a><p>首先看一段代码：</p>
<pre class="brush: java; title: ; notranslate">
dbo.getPreparedStatement(&quot;select * from (select * from Entity_HotLink wherehotLinkSortId = ? and hotLinkStatus = ? order by hotLinkOrder ASC, lastModifiedDate DESC) where ROWNUM &lt;= ?&quot;);
dbo.pstmt.setInt(1, hotLinkSortId);
dbo.pstmt.setInt(2, hotLinkStatus);
dbo.pstmt.setInt(3, count);
</pre>
<p>环境1：windows + oracle 10g 正常<br />
环境2: Redhat E5.2 64bit + oracle 10g(RAC集群) 查询执行，但是返回记录数只有10条，不管你的count有多大。</p>
<p>改成</p>
<pre class="brush: java; title: ; notranslate">
dbo.getPreparedStatement(&quot;select * from (select * from Entity_HotLink where hotLinkSortId = ? and hotLinkStatus = ? order by hotLinkOrder ASC, lastModifiedDate DESC) where ROWNUM &lt;= &quot; + count);
dbo.pstmt.setInt(1, hotLinkSortId);
dbo.pstmt.setInt(2, hotLinkStatus);
</pre>
<p>则都能正常查询记录。</p>
<p>此问题比较奇怪有问题再研究研究。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dreamidea.net/back-end/database/oracle_query_count_problem/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

