<?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: T-SQL Tuesday &#8211; HAVING Puzzle answer	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2010/01/12/t-sql-tuesday-having-puzzle-answer/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2010/01/12/t-sql-tuesday-having-puzzle-answer/</link>
	<description></description>
	<lastBuildDate>Wed, 20 Oct 2010 23:39:55 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.3</generator>
	<item>
		<title>
		By: Alvin		</title>
		<link>https://lobsterpot.com.au/blog/2010/01/12/t-sql-tuesday-having-puzzle-answer/#comment-722</link>

		<dc:creator><![CDATA[Alvin]]></dc:creator>
		<pubDate>Wed, 20 Oct 2010 23:39:55 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2010/01/12/t-sql-tuesday-having-puzzle-answer.aspx#comment-722</guid>

					<description><![CDATA[It seems that Oracle handles this differently.

Here is the result from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0

SELECT ‘No rows’
FROM DUAL
WHERE 1=2
HAVING 1=1
;
no rows selected]]></description>
			<content:encoded><![CDATA[<p>It seems that Oracle handles this differently.</p>
<p>Here is the result from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0</p>
<p>SELECT ‘No rows’<br />
FROM DUAL<br />
WHERE 1=2<br />
HAVING 1=1<br />
;<br />
no rows selected</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2010/01/12/t-sql-tuesday-having-puzzle-answer/#comment-723</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 21 Jan 2010 05:47:24 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2010/01/12/t-sql-tuesday-having-puzzle-answer.aspx#comment-723</guid>

					<description><![CDATA[Thanks Alvin.

If you have the time (and if you notice this comment), could you try:

SELECT dummy
FOM DUAL
HAVING 1=1;

In SQL, this would give an error, because it would force grouping to occur and then not know which value to use (despite there being only one). I suspect that Oracle might be seeing the 1=1 and ignore the line.

Again, thanks so much for your comment!

Rob]]></description>
			<content:encoded><![CDATA[<p>Thanks Alvin.</p>
<p>If you have the time (and if you notice this comment), could you try:</p>
<p>SELECT dummy<br />
FOM DUAL<br />
HAVING 1=1;</p>
<p>In SQL, this would give an error, because it would force grouping to occur and then not know which value to use (despite there being only one). I suspect that Oracle might be seeing the 1=1 and ignore the line.</p>
<p>Again, thanks so much for your comment!</p>
<p>Rob</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2010/01/12/t-sql-tuesday-having-puzzle-answer/#comment-721</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 14 Jan 2010 23:04:06 +0000</pubDate>
		<guid isPermaLink="false">/blogs/robfarley/archive/2010/01/12/t-sql-tuesday-having-puzzle-answer.aspx#comment-721</guid>

					<description><![CDATA[This got discussed at http://forum.lessthandot.com/viewtopic.php?f=17&amp;t=9479 – and my quick answer for those people is: “Using HAVING (or a GROUP BY, DISTINCT or any aggregate function) means that any rows returned refer to groups not records. In this case, there is one group, containing no records.”]]></description>
			<content:encoded><![CDATA[<p>This got discussed at <a href="http://forum.lessthandot.com/viewtopic.php?f=17&#038;t=9479" rel="nofollow ugc">http://forum.lessthandot.com/viewtopic.php?f=17&#038;t=9479</a> – and my quick answer for those people is: “Using HAVING (or a GROUP BY, DISTINCT or any aggregate function) means that any rows returned refer to groups not records. In this case, there is one group, containing no records.”</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
