how to find the second salary?

Answer Posted / kavitha

select max(salary) from tablename where salary not in(select
max(salary) from tablename )

or


select max(salary) from tablename where salary <(select
max(salary) from tablename )

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the command used to check locks in microsoft sql server?

537


What is a user-defined function in the sql server and what is its advantage?

613


why does a sql statement work correctly outside of a user-defined function, but incorrectly inside it? : Sql server administration

547


What is user-defined multi-statement table-valued function?

653


How to drop an existing table with "drop table" statements in ms sql server?

548






application server is slow what may be the problem

1778


Explain identity in sql server?

561


code to create procedure for taking databse backup in sql server or i have the query for it but what it's query returns means i want to show on my jsp that the databse backup has been taken on the basis of that return value.does it returns 0 or 1.wat is the code for that

1752


How can we check the sql server version?

552


What is nonclustered index with included columns ?

544


What is the new security features added in sql server 2014? : sql server security

559


What is the difference between left and right outer join?

537


you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration

533


What is the purpose of sql profiler in sql server? : sql server database administration

619


What are the different Topologies in which Replication can be configured?

635