<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ranking Functions: ROW_NUMBER</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx</link><description>SQL Server 2005 introduced four new functions, ROW_NUMBER, RANK, DENSE_RANK, and NTILE that are collectively referred to as ranking functions. These functions differ from ordinary scalar functions in that the result that they produce for a given row depends</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Ranking Functions: ROW_NUMBER</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx#10350131</link><pubDate>Mon, 17 Sep 2012 15:44:14 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10350131</guid><dc:creator>Craig Freedman</dc:creator><description>&lt;p&gt;The WHERE clause is applied before any aggregation or ranking functions and, thus, cannot reference the results of these functions including ROW_NUMBER(). &amp;nbsp;You can work around this limitation using subqueries or CTEs. &amp;nbsp;For example:&lt;/p&gt;
&lt;p&gt;SELECT *&lt;br /&gt;FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY B) AS RowNumber FROM T) Q&lt;br /&gt;WHERE RowNumber &amp;lt;= 3;&lt;/p&gt;
&lt;p&gt;WITH Q AS (SELECT *, ROW_NUMBER() OVER (ORDER BY B) AS RowNumber FROM T)&lt;br /&gt;SELECT * FROM Q WHERE RowNumber &amp;lt;= 3;&lt;/p&gt;
&lt;p&gt;HTH,&lt;br /&gt;Craig&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10350131" width="1" height="1"&gt;</description></item><item><title>re: Ranking Functions: ROW_NUMBER</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx#10349711</link><pubDate>Sat, 15 Sep 2012 06:47:19 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10349711</guid><dc:creator>sadegh</dc:creator><description>&lt;p&gt;why where clause doesn&amp;#39;t work on rowNumber column???&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10349711" width="1" height="1"&gt;</description></item><item><title>re: Ranking Functions: ROW_NUMBER</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx#10299141</link><pubDate>Mon, 30 Apr 2012 15:44:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10299141</guid><dc:creator>Craig Freedman</dc:creator><description>&lt;p&gt;Hi Naveen,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I follow your question. &amp;nbsp;SeqNum is computed by the ROW_NUMBER() function and cannot be updated directly. &amp;nbsp;Only by changing the values of Prcname and submitternode can you change the results generated by the ROW_NUMBER() function.&lt;/p&gt;
&lt;p&gt;HTH,&lt;/p&gt;
&lt;p&gt;Craig&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10299141" width="1" height="1"&gt;</description></item><item><title>re: Ranking Functions: ROW_NUMBER</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx#10298773</link><pubDate>Sat, 28 Apr 2012 23:08:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10298773</guid><dc:creator>Naveen</dc:creator><description>&lt;p&gt;Please could you tell me how to use below code to update field seqnum &lt;/p&gt;
&lt;p&gt;select*, -1+ROW_NUMBER() OVER (PARTITION BY Prcname ORDER BY submitternode) AS SeqNum FROM Test_nav1&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10298773" width="1" height="1"&gt;</description></item><item><title>Ranking Functions: RANK, DENSE_RANK, and NTILE</title><link>http://blogs.msdn.com/b/craigfr/archive/2008/03/19/ranking-functions-row-number.aspx#8346527</link><pubDate>Tue, 01 Apr 2008 00:14:57 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8346527</guid><dc:creator>Craig Freedman's SQL Server Blog</dc:creator><description>&lt;p&gt;In my previous post , I discussed the ROW_NUMBER ranking function which was introduced in SQL Server&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8346527" width="1" height="1"&gt;</description></item></channel></rss>