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

Answers were Sorted based on User's Feedback



How to find the second largest salary in the emp database and also How to find 3rd,4th and so on ....

Answer / sridhar

select gross_pay from tbl_payroll where gross_pay != (select
max(gross_pay) from tbl_payroll) limit 0,3

Is This Answer Correct ?    0 Yes 8 No

How to find the second largest salary in the emp database and also How to find 3rd,4th and so on ....

Answer / rajeev

select salary-1 from users where salary in (select
max(salary) from users);

Is This Answer Correct ?    0 Yes 8 No

How to find the second largest salary in the emp database and also How to find 3rd,4th and so on ....

Answer / ashish kumar

To find nth maximum salry

Select salary from tbl_name a where
n-1=(Select count(distinct(count(*))) from tbl_name b
where b.salary>a.salary)

Is This Answer Correct ?    10 Yes 20 No

How to find the second largest salary in the emp database and also How to find 3rd,4th and so on ....

Answer / suhail

select top 1 salary from (select top 5 salary from
emp_table order by salary desc)temptable order by salary asc

Is This Answer Correct ?    17 Yes 36 No

How to find the second largest salary in the emp database and also How to find 3rd,4th and so on ....

Answer / gunjan sapra

select top 10 from tbl_name order by salary desc

Is This Answer Correct ?    4 Yes 39 No

Post New Answer

More SQL Server Interview Questions

What is the primary use of the model database?

0 Answers  


How do you optimize Sql queries ?

0 Answers   Cognizant,


How many joins in sql server?

0 Answers  


Explain the concepts and capabilities of sql server?

0 Answers  


How To Change Column Ordinal Position in SQL Server 2005 using Query i.e I Want To Add Column at Particular Ordinal Position in SQL Server 2005

2 Answers  






if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

0 Answers  


Explain having clause?

0 Answers  


In what sequence sql statement is processed?

0 Answers  


Join 3 tables (table1, table2 & table3) in a single query. Inner join should be applied for table1 & table 2 and left outer join for table1 & table3 where table2.dept is ABC

2 Answers  


What is the sql profiler?

0 Answers  


What does Master database contains?

0 Answers   Abacus,


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

0 Answers  


Categories