 




<?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 query &#8211; Unique item with latest date of entry</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/sql-query-unique-item-with-latest-date-of-entry/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-query-unique-item-with-latest-date-of-entry/</link>
	<description></description>
	<lastBuildDate>Fri, 24 May 2013 17:13:17 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: mafacrofos</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-query-unique-item-with-latest-date-of-entry/#comment-103060</link>
		<dc:creator>mafacrofos</dc:creator>
		<pubDate>Fri, 17 Feb 2012 20:46:06 +0000</pubDate>
		<guid isPermaLink="false">#comment-103060</guid>
		<description><![CDATA[YEEEEEEAAAAAAAAAA]]></description>
		<content:encoded><![CDATA[<p>YEEEEEEAAAAAAAAAA</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: frankkulash</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-query-unique-item-with-latest-date-of-entry/#comment-50888</link>
		<dc:creator>frankkulash</dc:creator>
		<pubDate>Mon, 17 Dec 2007 20:41:15 +0000</pubDate>
		<guid isPermaLink="false">#comment-50888</guid>
		<description><![CDATA[Hi,

This will get all the columns associated with the last date for each itemN:
&lt;pre&gt;
SELECT	*
FROM	tableName	m
WHERE	date =
	(
	SELECT	MAX (date)
	FROM	tableName
	WHERE	itemN	= m.itemN
	)
ORDER BY	itemN;
&lt;/pre&gt;
If there is a tie for the last date in any itemN, all contenders will be selected.
There may be a more elegant way to do this, using TOP.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This will get all the columns associated with the last date for each itemN:</p>
<pre>
SELECT	*
FROM	tableName	m
WHERE	date =
	(
	SELECT	MAX (date)
	FROM	tableName
	WHERE	itemN	= m.itemN
	)
ORDER BY	itemN;
</pre>
<p>If there is a tie for the last date in any itemN, all contenders will be selected.<br />
There may be a more elegant way to do this, using TOP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smurkyis</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/sql-query-unique-item-with-latest-date-of-entry/#comment-50887</link>
		<dc:creator>smurkyis</dc:creator>
		<pubDate>Mon, 17 Dec 2007 19:38:25 +0000</pubDate>
		<guid isPermaLink="false">#comment-50887</guid>
		<description><![CDATA[Denny,  
            that is really cool and simple logic, but I have to get all of the fields (10 in  number) for my final resultant table.]]></description>
		<content:encoded><![CDATA[<p>Denny,<br />
            that is really cool and simple logic, but I have to get all of the fields (10 in  number) for my final resultant table.</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 6/9 queries in 0.014 seconds using memcached
Object Caching 296/299 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-24 18:14:31 -->