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.
| Author |
Topic |
|
dasu
Posting Yak Master
104 Posts |
Posted - 2004-10-10 : 04:13:48
|
| please suggest me the solution for how to get 3rd maximum in a table mssqlserver with out using top regardsdasu.g |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2004-10-10 : 11:39:45
|
like this:this will return 3rd max salary from employeesdeclare @n intset @n = 3 -- n-th value tp getSelect * From Employee E1 Where (@n-1) = (Select Count(Distinct(E2.Salary)) From Employee E2 Where E2.Salary > E1.Salary) hope it helps.Go with the flow & have fun! Else fight the flow |
 |
|
|
|
|
|