Write a query to find second highest salary of an employee.

Answer Posted / preetir

select min(sal) from (select distinct sal from emp order by
desc where rownum < 2)

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Are sql connections encrypted?

560


What are sql functions? Describe in brief different types of sql functions?

490


What does fetching a cursor do?

617


Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?

671


what is subquery? : Sql dba

572






What is dbo in sql?

536


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

513


Can you join views in sql?

544


What is count * in sql?

558


How do I tune a sql query?

514


How do you optimize a stored procedure in sql?

504


What is dynamic sql in pl sql?

497


How does a self join work?

520


What are the different tcl commands in sql?

624


What is embedded sql what are its advantages?

507