Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 How to find third maximum in a Table?

Author  Topic 

umapathy
Starting Member

24 Posts

Posted - 2008-01-28 : 04:12:11
Hi all,

How to write a query for find third maximum record in a Table?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-01-28 : 04:15:42
SELECT MIN(Col) FROM (SELECT TOP 3 Col1 FROM Table1 ORDER BY Col1 DESC) AS d



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

sunil
Constraint Violating Yak Guru

282 Posts

Posted - 2008-01-28 : 04:15:52
Have a look at this article lying on the home page of sqlteam.com. Seems like preparing for or done with a interview.
http://weblogs.sqlteam.com/markc/archive/2008/01/24/60464.aspx
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-28 : 04:16:17
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/find-nth-maximum-value.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-01-28 : 04:16:47



Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -