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 |
|
Suresh_C
Starting Member
1 Post |
Posted - 2003-09-30 : 01:02:50
|
| This is a query to find out Nth Max:select a.qty from sales a where N = (select count(distinct b.qty) from sales b where a.qty <= b.qty)Can anyone please tell me whats happening in this query and how it returns Nth max?Thanks in advance. |
|
|
rrb
SQLTeam Poet Laureate
1479 Posts |
Posted - 2003-09-30 : 01:28:04
|
| Hi SureshThis may help..."find the value from the table, where N = the number of different values which are greater than/equal to the current value"HTH--I hope that when I die someone will say of me "That guy sure owed me a lot of money" |
 |
|
|
|
|
|