<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Download Logical Query Processing Poster</title>
	<atom:link href="http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Sun, 12 Feb 2012 09:22:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Terry Smith</title>
		<link>http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/#comment-212932</link>
		<dc:creator><![CDATA[Terry Smith]]></dc:creator>
		<pubDate>Wed, 07 Dec 2011 19:17:35 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7043#comment-212932</guid>
		<description><![CDATA[In Itzik&#039;s book, he lists Order by before Top, as #10 and #11, respectively.]]></description>
		<content:encoded><![CDATA[<p>In Itzik&#8217;s book, he lists Order by before Top, as #10 and #11, respectively.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Partha Dutta Gupta</title>
		<link>http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/#comment-147165</link>
		<dc:creator><![CDATA[Partha Dutta Gupta]]></dc:creator>
		<pubDate>Sat, 09 Jul 2011 20:52:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7043#comment-147165</guid>
		<description><![CDATA[Nice Pinal.

Just Have a look at the following:

CREATE TABLE AA(PRODCODE CHAR(5),
RATE DECIMAL(20,2) NOT NULL DEFAULT 0,
LAST_REC CHAR(1) NOT NULL DEFAULT &#039;&#039;)

INSERT AA VALUES(&#039;P1&#039;,25,&#039;L&#039;)
INSERT AA VALUES(&#039;P1&#039;,0,&#039;&#039;)

SELECT * FROM AA

CREATE TABLE BB(PRODCODE CHAR(5),
RATE DECIMAL(20,2) NOT NULL DEFAULT 0)

INSERT BB VALUES(&#039;P1&#039;,0)
INSERT BB VALUES(&#039;P2&#039;,0)

UPDATE BB SET RATE=
ISNULL((SELECT TOP 1 1/RATE FROM AA WHERE AA.PRODCODE=BB.PRODCODE),0)
-- It says (2 row(s) affected)
-- If TOP would not have executed first then we naturally get 
-- a divide by zero error as in the next command
UPDATE BB SET RATE=
ISNULL((SELECT TOP 1 1/RATE FROM AA WHERE AA.PRODCODE=BB.PRODCODE ORDER BY RATE),0)
-- Msg 8134, Level 16, State 1, Line 1
--Divide by zero error encountered.
--The statement has been terminated.

-- Thus we may also conclude that the evaluation of Expressions and Column values in  select statement is also restricted on TOP. Only TOP % or Number rows --column are  retrieved or expressions are evaluated. Executing Order BY first than TOP would naturally lead to a divide by zero eror.]]></description>
		<content:encoded><![CDATA[<p>Nice Pinal.</p>
<p>Just Have a look at the following:</p>
<p>CREATE TABLE AA(PRODCODE CHAR(5),<br />
RATE DECIMAL(20,2) NOT NULL DEFAULT 0,<br />
LAST_REC CHAR(1) NOT NULL DEFAULT &#8221;)</p>
<p>INSERT AA VALUES(&#8216;P1&#8242;,25,&#8217;L')<br />
INSERT AA VALUES(&#8216;P1&#8242;,0,&#8221;)</p>
<p>SELECT * FROM AA</p>
<p>CREATE TABLE BB(PRODCODE CHAR(5),<br />
RATE DECIMAL(20,2) NOT NULL DEFAULT 0)</p>
<p>INSERT BB VALUES(&#8216;P1&#8242;,0)<br />
INSERT BB VALUES(&#8216;P2&#8242;,0)</p>
<p>UPDATE BB SET RATE=<br />
ISNULL((SELECT TOP 1 1/RATE FROM AA WHERE AA.PRODCODE=BB.PRODCODE),0)<br />
&#8211; It says (2 row(s) affected)<br />
&#8211; If TOP would not have executed first then we naturally get<br />
&#8211; a divide by zero error as in the next command<br />
UPDATE BB SET RATE=<br />
ISNULL((SELECT TOP 1 1/RATE FROM AA WHERE AA.PRODCODE=BB.PRODCODE ORDER BY RATE),0)<br />
&#8211; Msg 8134, Level 16, State 1, Line 1<br />
&#8211;Divide by zero error encountered.<br />
&#8211;The statement has been terminated.</p>
<p>&#8211; Thus we may also conclude that the evaluation of Expressions and Column values in  select statement is also restricted on TOP. Only TOP % or Number rows &#8211;column are  retrieved or expressions are evaluated. Executing Order BY first than TOP would naturally lead to a divide by zero eror.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 5 of 31 Journey to SQLAuthority</title>
		<link>http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/#comment-145991</link>
		<dc:creator><![CDATA[SQL SERVER – Interview Questions and Answers – Frequently Asked Questions – Day 5 of 31 Journey to SQLAuthority]]></dc:creator>
		<pubDate>Tue, 05 Jul 2011 01:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7043#comment-145991</guid>
		<description><![CDATA[[...] (Read more here) [...]]]></description>
		<content:encoded><![CDATA[<p>[...] (Read more here) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brian Tkatch</title>
		<link>http://blog.sqlauthority.com/2009/10/10/sql-server-download-logical-query-processing-poster/#comment-56627</link>
		<dc:creator><![CDATA[Brian Tkatch]]></dc:creator>
		<pubDate>Mon, 12 Oct 2009 20:54:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/?p=7043#comment-56627</guid>
		<description><![CDATA[Nice poster.]]></description>
		<content:encoded><![CDATA[<p>Nice poster.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

