Find 2nd Highest salery in emp table

Select* from emp where &n=
select * count from emp where (salery >=emp.salery)


Enter n value 2


These query is correct or not. Tell me any other methods.

Answer Posted / asimananda

SELECT MAX(SAL) FROM EMP WHERE SAL < ( SELECT MAX(SAL) FROM
EMP )

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Relational calculus is what type of language?

780


What is stored procedures?

715


How global temporary tables are represented and its scope?

721


Can sql servers linked to other servers?

732


How to use transact-sql statements to access the database engine?

746






What is merge replication?

863


Explain the use of containers in ssis?

679


what information is maintained within the msdb database? : Sql server administration

700


What can be used instead of trigger?

799


What is normalization? What number of normalization shapes are there?

801


In which sql server version report builder introduced?

125


What stored by the master?

718


What is create statement?

681


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

710


what is create database syntax? : Sql server database administration

795