﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Discuss content posted by ~~Hari.Bagra / Article Discussions by Author  / Find Nth Maximum from a Table... / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Mon, 20 May 2013 12:54:10 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Find Nth Maximum from a Table...</title><link>http://www.sqlservercentral.com/Forums/Topic404608-555-1.aspx</link><description>top 5th Salary of every departmentSELECT * FROM (SELECT EMP_ID, DEPT_ID, SALARY, NAME,RANK() OVER (PARTITION BY DEPT_ID ORDER BY SALARY DESC) AS RANKIDFROM EMP) A WHERE RANKID = 5</description><pubDate>Mon, 17 Aug 2009 23:49:50 GMT</pubDate><dc:creator>Amulya Dutta</dc:creator></item><item><title>RE: Find Nth Maximum from a Table...</title><link>http://www.sqlservercentral.com/Forums/Topic404608-555-1.aspx</link><description>May be the old thread but I want to show you other approaches[url]http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/find-nth-maximum-value.aspx[/url]</description><pubDate>Fri, 19 Sep 2008 06:59:48 GMT</pubDate><dc:creator>Madhivanan-208264</dc:creator></item><item><title>RE: Find Nth Maximum from a Table...</title><link>http://www.sqlservercentral.com/Forums/Topic404608-555-1.aspx</link><description>Hi,  This query is absolutely woking fine ...but if two employees r aving the same salary then it does not show correct result.. actuly it should show both employees for that rank.  this can be found using this query...:--&amp;gt;select * from @table where salary in (select top 1 salary   from @table                       where salary in (select top [b][size="4"]3[/size][/b] salary from @Table order                                                 by salary [b]desc[/b]                                           )                      order by salary                     ) Looks complicated but not so ...</description><pubDate>Sun, 21 Oct 2007 23:25:18 GMT</pubDate><dc:creator>Dhananjay Kulkarni-482726</dc:creator></item><item><title>Find Nth Maximum from a Table...</title><link>http://www.sqlservercentral.com/Forums/Topic404608-555-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Miscellaneous/31921/"&gt;Find Nth Maximum from a Table...&lt;/A&gt;[/B]</description><pubDate>Sat, 29 Sep 2007 23:57:00 GMT</pubDate><dc:creator>Hari.Sharma</dc:creator></item></channel></rss>