<?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: An aggregate may not appear in the WHERE clause unless it is in a subquery contained in a HAVING clause or a select list, and the column being aggregated is an outer reference.</title>
	<atom:link href="http://www.sql-server-performance.com/2007/aggregate-may-not-appear-in-where-clause/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sql-server-performance.com/2007/aggregate-may-not-appear-in-where-clause/</link>
	<description>SQL Server Performance Tuning</description>
	<lastBuildDate>Fri, 17 May 2013 13:31:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Vignesh</title>
		<link>http://www.sql-server-performance.com/2007/aggregate-may-not-appear-in-where-clause/#comment-2634</link>
		<dc:creator>Vignesh</dc:creator>
		<pubDate>Sun, 09 Dec 2012 03:52:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.sql-server-performance.com/?=1213#comment-2634</guid>
		<description><![CDATA[It depends on the situation - for this, it looks like you want &quot;ALL&quot;, so probably a simple where clause, so something like :
SELECT *
  FROM Northwind.dbo.Orders
 WHERE OrderDate &lt; GETDATE()
Change: I removed the &quot;MAX&quot;
If that does not do it for you, and you have a particular column you need, using a GROUP BY Clause would work in some, &quot;Having&quot; would work in others.
Some related (but not exactly) information is on
 http://exacthelp.blogspot.com/2012/04/aggregate-cannot-appear-in-on-clause.html.]]></description>
		<content:encoded><![CDATA[<p>It depends on the situation &#8211; for this, it looks like you want &#8220;ALL&#8221;, so probably a simple where clause, so something like :</p>
<p>SELECT *<br />
  FROM Northwind.dbo.Orders<br />
 WHERE OrderDate &lt; GETDATE()</p>
<p>Change: I removed the &quot;MAX&quot;</p>
<p>If that does not do it for you, and you have a particular column you need, using a GROUP BY Clause would work in some, &quot;Having&quot; would work in others.</p>
<p>Some related (but not exactly) information is on<br />
 <a href="http://exacthelp.blogspot.com/2012/04/aggregate-cannot-appear-in-on-clause.html" rel="nofollow">http://exacthelp.blogspot.com/2012/04/aggregate-cannot-appear-in-on-clause.html</a>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
