<?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: Advanced SQL &#8211; Selecting Rows with Max Value from Groups</title>
	<atom:link href="http://www.bryantsai.com/archives/advanced-sql-selecting-rows-with-max-value-from-groups.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bryantsai.com/archives/advanced-sql-selecting-rows-with-max-value-from-groups.html</link>
	<description>I need to think ...</description>
	<lastBuildDate>Sun, 10 Jun 2007 16:32:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.bryantsai.com/archives/advanced-sql-selecting-rows-with-max-value-from-groups.html/comment-page-1#comment-13</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 10 Jun 2007 16:32:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.bryantsai.com/?p=36#comment-13</guid>
		<description>You can rewrite it using related subquery:

SELECT department, name, salary FROM DEPARTMENT dept
  WHERE salary=
    (SELECT max(salary) FROM DEPARTMENT WHERE department=dept.department)

But I am not sure if it performs better than yours.</description>
		<content:encoded><![CDATA[<p>You can rewrite it using related subquery:</p>
<p><span class="caps">SELECT </span>department, name, salary <span class="caps">FROM DEPARTMENT </span>dept<br />
  <span class="caps">WHERE </span>salary=<br />
    (SELECT max(salary) <span class="caps">FROM DEPARTMENT WHERE </span>department=dept.department)</p>
<p>But I am not sure if it performs better than yours.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

