WITH RESULT AS (SELECT SALARY,DENSE_RANK() OVER (ORDER BY SALARY DESC) AS DENSERANKFROM EMPLOYEES ) SELECT TOP 1 SALARY FROM RESULT WHERE DENSERANK = 5Never use ROW_NUMBER(). Always use DENSE_RANK()
SELECT TOP 1 SALARY FROM (SELECT DISTINCT TOP 5 SALARY FROM EMPLOYEES ORDER BY SALARY DESC ) RESULT ORDER BY SALARY
WITH Salaries AS (SELECT SalaryAmount, ROW_NUMBER() OVER(ORDER BY SalaryAmount DESC) AS 'RowNum'FROM dbo.SalaryTable ) SELECTSalaryAmount FROMSalaries WHERERowNum = 5
1) C# doesn't support Multiple inheritance ( means deriving a class from more than one class)... If your application supposed to have more than one class features at a time, For ex : we can inherit one class and other interface as follows: Public class ChildClass : BaseClass, BaseInterface{ ................ }) An abstract class can have shared state or functionality. An interface is only a promise to provide the state or functionality. A good abstract class will reduce the amount of code that has to be rewritten because it's functionality or state can be shared. The interface has no defined information to be shared
Select Min(Salary) from ( Select top 5 Salary from table order by desc) T1