How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / aditya kumar bisoi
SELECT EmpId,Salary
FROM(SELECT ROW_NUMBER() OVER(ORDER BY Salary Desc) AS [ROW_NUMBER],* FROM (SELECT DISTINCT Salary,Empid FROM EMPDetails)Emp)Emp1
WHERE ROW_NUMBER BETWEEN 2 AND 5
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How to provide values to stored procedure parameters in ms sql server?
How to find the login name linked to a given user name?
What does the not null constraint do?
What are cascading parameters in ssrs reports?
What is attribute relationships, why we need it? : sql server analysis services, ssas
What are the filtered indexes?
Write a Select Query to display title for each group of records, which are collected with Compute Clause? Like titlefield column-A column-B ..... ..... ..... Sum ... titlefield column-A column-B ..... ..... ..... Sum ...
Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
What is difference between unique and primary key?
Define tool Manage Statistics in SQL Server 2000 query ?
How to download and install microsoft sql server management studio express?
Can one drop a column from a table?
how many bits ip address consist of? : Sql server database administration
How to retrieve error messages using mssql_get_last_message()?
What are system databases in ms sql server?