tony, you may have confused the issue by jumping from the second highest to the fifth
here's another way to get the row with the second highest value:
Code:
select Salesman, SaleAmount
from SalesTable
where SaleAmount =
( select max(SaleAmount)
from SalesTable
where SaleAmount <
( select max(SaleAmount)
from SalesTable
)
)
in english, "get the row where the SaleAmount is the highest SaleAmount that is less than the highest overall SaleAmount"
wouldn't want to nest that too deeply, eh
i believe a good optimiser will evaluate the innermost first (it is not correlated), then the next inner, then do a straight retrieval -- i could be wrong, though (it
has happened, and optimizer performance is not my long suit)
rudy
http://r937.com