To find second largest salary in Employee table

Answer Posted / satish

select salary from emp_Table_1 where 2= (select count(*)
form emp_Table_2 where emp_Table_2.salary < emp_Table_1.salary)

-satish

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to transfer an existing table from one schema to another schema in ms sql server?

506


What is an example of a foreign key?

507


Explain what is it unwise to create wide clustered index keys?

542


What are types of subqueries?

555


How can you insert values in multiple rows using one Insert statement?

615






what are different types of backups available in sql server? : Sql server database administration

496


How to edit table in sql server 2017?

506


Describe different Processing Modes offered by SSRS?

164


Explain about SQL server 2005?

555


How to transfer data from a cursor to variables with a "fetch" statement?

582


What command would you use to add a column to a table in sql server?

745


Why use triggers?

567


Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

656


Write SQL queries on Self Join and Inner Join.

606


Write an sql query for deleting duplicate rows?

549