<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: SQL statement using RRN(file)  on join pulling only Max(date) records from second file in iSeries</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 21:45:09 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: bigkat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/#comment-51724</link>
		<dc:creator>bigkat</dc:creator>
		<pubDate>Thu, 21 Feb 2008 14:22:43 +0000</pubDate>
		<guid isPermaLink="false">#comment-51724</guid>
		<description><![CDATA[That is strange, because I couldn&#039;t get it to run anything similar &lt;i&gt;without&lt;/i&gt; including the RRN in the GROUP BY???  

Anyway, glad you got it working, but the subselect had to cause a performance hit.  I hope there aren&#039;t too many records in the file.]]></description>
		<content:encoded><![CDATA[<p>That is strange, because I couldn&#8217;t get it to run anything similar <i>without</i> including the RRN in the GROUP BY???  </p>
<p>Anyway, glad you got it working, but the subselect had to cause a performance hit.  I hope there aren&#8217;t too many records in the file.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: isjld</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/#comment-51699</link>
		<dc:creator>isjld</dc:creator>
		<pubDate>Wed, 20 Feb 2008 15:07:07 +0000</pubDate>
		<guid isPermaLink="false">#comment-51699</guid>
		<description><![CDATA[I tried the group by with the RRN before I submitted my question.
As a matter of fact I tried multiple ways to get my data.  As long as I didn&#039;t use the RRN it would work.
In the SQL manual, in the section on RRN it states:
The argument must not identify a view, common table expression, or derived table whose outer subselect includes a column function, a GROUP BY clause, a HAVING clause, a UNION clause, an INTERSECT clause, or DISTINCT clause. The RRN function cannot be specified in a SELECT clause if the subselect contains a column function, a GROUP BY clause, or a HAVING clause. If the argument is a correlation name, the correlation name must not identify a correlated reference.

Anyway the way I finally worked it out was I joined my two files and then added within my where statement another select statement getting my max(eccdte):
where ECCDTE = (SELECT MAX(ECCDTE)FROM XTF420 where XTF420.eccntr = XTF419.eicntr and XTF420.ecemp = XTF419.eiemp and XTF420.eccnbr = XTL420L1.eccnbr group by XTF420.eccntr, XTF420.ecemp, XTF420.eccnbr ).
Thanks for your responses...]]></description>
		<content:encoded><![CDATA[<p>I tried the group by with the RRN before I submitted my question.<br />
As a matter of fact I tried multiple ways to get my data.  As long as I didn&#8217;t use the RRN it would work.<br />
In the SQL manual, in the section on RRN it states:<br />
The argument must not identify a view, common table expression, or derived table whose outer subselect includes a column function, a GROUP BY clause, a HAVING clause, a UNION clause, an INTERSECT clause, or DISTINCT clause. The RRN function cannot be specified in a SELECT clause if the subselect contains a column function, a GROUP BY clause, or a HAVING clause. If the argument is a correlation name, the correlation name must not identify a correlated reference.</p>
<p>Anyway the way I finally worked it out was I joined my two files and then added within my where statement another select statement getting my max(eccdte):<br />
where ECCDTE = (SELECT MAX(ECCDTE)FROM XTF420 where XTF420.eccntr = XTF419.eicntr and XTF420.ecemp = XTF419.eiemp and XTF420.eccnbr = XTL420L1.eccnbr group by XTF420.eccntr, XTF420.ecemp, XTF420.eccnbr ).<br />
Thanks for your responses&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bigkat</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/#comment-51695</link>
		<dc:creator>bigkat</dc:creator>
		<pubDate>Wed, 20 Feb 2008 14:27:49 +0000</pubDate>
		<guid isPermaLink="false">#comment-51695</guid>
		<description><![CDATA[Well, I assumed this was a one-to-many join, as the XTF419 fields were all already being grouped, and the XTL420L1 file was the one with a field that had a max() on it.

Regardless, all fields not in a function like max() need to be in the GROUP BY clause.

Kevin C. Ketzler]]></description>
		<content:encoded><![CDATA[<p>Well, I assumed this was a one-to-many join, as the XTF419 fields were all already being grouped, and the XTL420L1 file was the one with a field that had a max() on it.</p>
<p>Regardless, all fields not in a function like max() need to be in the GROUP BY clause.</p>
<p>Kevin C. Ketzler</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: plexpro</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-statement-using-rrnfile-on-join-pulling-only-maxdate-records-from-second-file/#comment-51670</link>
		<dc:creator>plexpro</dc:creator>
		<pubDate>Tue, 19 Feb 2008 16:06:37 +0000</pubDate>
		<guid isPermaLink="false">#comment-51670</guid>
		<description><![CDATA[&gt;&gt; You need to include the RRN(XTF419) in the GROUP BY clause

It seems to me that adding the RRN to the group by clause would return all groups of one record, and defeat the purpose.  Am I misunderstanding something about RRN?

René Valencourt]]></description>
		<content:encoded><![CDATA[<p>&gt;&gt; You need to include the RRN(XTF419) in the GROUP BY clause</p>
<p>It seems to me that adding the RRN to the group by clause would return all groups of one record, and defeat the purpose.  Am I misunderstanding something about RRN?</p>
<p>René Valencourt</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.037 seconds using memcached
Object Caching 309/315 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-18 21:51:41 -->