<?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: The power of T-SQL&#8217;s APPLY operator	</title>
	<atom:link href="https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/feed/" rel="self" type="application/rss+xml" />
	<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/</link>
	<description></description>
	<lastBuildDate>Thu, 01 Mar 2018 14:12:50 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1734</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 01 Mar 2018 14:12:50 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1734</guid>

					<description><![CDATA[Chris - try grabbing it from https://1drv.ms/v/s!AoK2mL8SvaMytzvfE5N1LOrdIJgj]]></description>
			<content:encoded><![CDATA[<p>Chris &#8211; try grabbing it from <a href="https://1drv.ms/v/s!AoK2mL8SvaMytzvfE5N1LOrdIJgj" rel="nofollow ugc">https://1drv.ms/v/s!AoK2mL8SvaMytzvfE5N1LOrdIJgj</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1733</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Thu, 01 Mar 2018 14:08:36 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1733</guid>

					<description><![CDATA[Hi Chris,

I don&#039;t have much control over the SQLBits site. I can try to ask them maybe...

But I&#039;m not sure I do cover the idea of using a view instead of APPLY. Both are useful in their way, but APPLY is certainly very useful for the fact that it provides correlation in a much easier way.]]></description>
			<content:encoded><![CDATA[<p>Hi Chris,</p>
<p>I don&#8217;t have much control over the SQLBits site. I can try to ask them maybe&#8230;</p>
<p>But I&#8217;m not sure I do cover the idea of using a view instead of APPLY. Both are useful in their way, but APPLY is certainly very useful for the fact that it provides correlation in a much easier way.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Chris		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1732</link>

		<dc:creator><![CDATA[Chris]]></dc:creator>
		<pubDate>Mon, 05 Feb 2018 15:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1732</guid>

					<description><![CDATA[I&#039;m intrigued by the aside about using begin/end rendering the sql &quot;non-simplifiable.&quot;  Unfortunately, while the shortcut URL http://bit.ly/SimpleRob correctly links to http://sqlbits.com/Sessions/Event5/Designing_for_simplification , the presentation on the destination page is not functioning, nor is the link to the presentation wmv file (the links to ppt and demo sql work fine, though).

Specifically, I&#039;m not seeing why APPLY with a table function is simpler than - or preferable to - an inline view.  Most correlated subqueries I&#039;ve come across can be converted to a join to an inline view in the main body of the procedure without using a correlation in the where clause.  This is likely covered in the broken presentation link.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m intrigued by the aside about using begin/end rendering the sql &#8220;non-simplifiable.&#8221;  Unfortunately, while the shortcut URL <a href="http://bit.ly/SimpleRob" rel="nofollow ugc">http://bit.ly/SimpleRob</a> correctly links to <a href="http://sqlbits.com/Sessions/Event5/Designing_for_simplification" rel="nofollow ugc">http://sqlbits.com/Sessions/Event5/Designing_for_simplification</a> , the presentation on the destination page is not functioning, nor is the link to the presentation wmv file (the links to ppt and demo sql work fine, though).</p>
<p>Specifically, I&#8217;m not seeing why APPLY with a table function is simpler than &#8211; or preferable to &#8211; an inline view.  Most correlated subqueries I&#8217;ve come across can be converted to a join to an inline view in the main body of the procedure without using a correlation in the where clause.  This is likely covered in the broken presentation link.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jodie		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1731</link>

		<dc:creator><![CDATA[Jodie]]></dc:creator>
		<pubDate>Tue, 28 Jun 2016 18:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1731</guid>

					<description><![CDATA[I know I&#039;m a few years late, but just wanted to say thanks for such a well-explained article and the highly useful examples. I will definitely keep Apply in mind for future SQL conundrums! Thank you :-)]]></description>
			<content:encoded><![CDATA[<p>I know I&#8217;m a few years late, but just wanted to say thanks for such a well-explained article and the highly useful examples. I will definitely keep Apply in mind for future SQL conundrums! Thank you 🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johnny		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1730</link>

		<dc:creator><![CDATA[Johnny]]></dc:creator>
		<pubDate>Sat, 03 Oct 2015 01:25:49 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1730</guid>

					<description><![CDATA[Great article.]]></description>
			<content:encoded><![CDATA[<p>Great article.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jean Joseph		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1729</link>

		<dc:creator><![CDATA[Jean Joseph]]></dc:creator>
		<pubDate>Thu, 16 Oct 2014 03:04:24 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1729</guid>

					<description><![CDATA[Cool article]]></description>
			<content:encoded><![CDATA[<p>Cool article</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Valeriy Khvalabov		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1728</link>

		<dc:creator><![CDATA[Valeriy Khvalabov]]></dc:creator>
		<pubDate>Fri, 13 Jun 2014 17:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1728</guid>

					<description><![CDATA[Thank you Rob,
A great article!
You made the explanation simple and straight-forward.]]></description>
			<content:encoded><![CDATA[<p>Thank you Rob,<br />
A great article!<br />
You made the explanation simple and straight-forward.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Rob Farley		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1727</link>

		<dc:creator><![CDATA[Rob Farley]]></dc:creator>
		<pubDate>Fri, 06 Jun 2014 05:13:09 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1727</guid>

					<description><![CDATA[You can always use TOP (3) WITH TIES...]]></description>
			<content:encoded><![CDATA[<p>You can always use TOP (3) WITH TIES&#8230;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Andrew Watson		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1726</link>

		<dc:creator><![CDATA[Andrew Watson]]></dc:creator>
		<pubDate>Fri, 06 Jun 2014 04:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1726</guid>

					<description><![CDATA[One minor comment.. While top(3) works... I would humbly suggest that it won&#039;t cope very well if the Business requirement, is &#034;return the top 3 performers, by sales amount&#034;... if the amounts are ever tied.... 
eg:if the product sums are:
One:1000
Two: 800
Three: 500
Four: 500
Would the business want to return the top 4 in this case (as there is a tie for third place), or have a random selection of Three/Four?.
If they would want to see both, then the With query with a RANK (rather than Row_number) function is the more appropriate choice.... definitely more adjustable to business rules &#160;(rank = top performers by amount, dense_rank = top amounts and products with those amounts, row_number = top three by amount [and some other ordering criteria])... don&#039;t fight it. &#160;:)]]></description>
			<content:encoded><![CDATA[<p>One minor comment.. While top(3) works&#8230; I would humbly suggest that it won&#8217;t cope very well if the Business requirement, is &quot;return the top 3 performers, by sales amount&quot;&#8230; if the amounts are ever tied&#8230;.<br />
eg:if the product sums are:<br />
One:1000<br />
Two: 800<br />
Three: 500<br />
Four: 500<br />
Would the business want to return the top 4 in this case (as there is a tie for third place), or have a random selection of Three/Four?.<br />
If they would want to see both, then the With query with a RANK (rather than Row_number) function is the more appropriate choice&#8230;. definitely more adjustable to business rules &nbsp;(rank = top performers by amount, dense_rank = top amounts and products with those amounts, row_number = top three by amount [and some other ordering criteria])&#8230; don&#8217;t fight it. &nbsp;🙂</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Dave		</title>
		<link>https://lobsterpot.com.au/blog/2011/04/13/the-power-of-t-sqls-apply-operator/#comment-1725</link>

		<dc:creator><![CDATA[Dave]]></dc:creator>
		<pubDate>Mon, 10 Mar 2014 08:51:01 +0000</pubDate>
		<guid isPermaLink="false">http://blogs.lobsterpot.com.au/?p=2921#comment-1725</guid>

					<description><![CDATA[...and it works fine doh. Poor internet today]]></description>
			<content:encoded><![CDATA[<p>&#8230;and it works fine doh. Poor internet today</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
