I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000

Answer Posted / belson gnana pradeep

Select Top 1 salary from (Select TOP 2 salary from tbl_salary order by salary desc)a order by salary

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I open port 1433?

612


How to create function with parameter in sql server?

644


Can we use trigger new in before insert?

602


What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?

648


What are triggers? How do you invoke a trigger on demand?

843






How many joins in sql server?

603


What is failover clustering overview?

672


Mention the 3 ways to get a count of the number of records in a table.

625


What is the use of commit?

648


Is sql different from sql server?

606


What is instead of trigger sql server?

589


What are sql azure firewall rules?

89


What is dml command?

621


What is scan table/view and seek table/view when its occurs? : sql server database administration

608


What is a trigger? Why we need it?

599