1. WITH Results as (SELECT Row_Number() over (ORDER BY Salary DESC) as RN,* FROM tbPay) SELECT * FROM Results WHERE RN=2 2. select PayAmount from ( select *,ROW_NUMBER()over(order by PayAmount desc)High from tbpay )a where High=2
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)