find the second highest salary of the emp table

Answer Posted / ramesh.ch

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


explanation::

first sub query returns maximum salary of employee
than main query returns maximum salary lessthan the maximum
salary return by subquery

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a hot backup and a cold backup in oracle?

754


I have a table called 'test' on source and target with same name, structure and data type but in a different column order. How can you setup replication for this table?

865


What is a cursor variable?

773


What is data type in oracle?

754


How to run create database statement?

751


How do I find my oracle client driver version?

715


What is a connect identifier?

739


What is the quickest way to fetch the data from a table?

790


what is the difference between data migration and production migration.

2032


Why should I use oracle database?

736


Describe varray?

820


How to change program global area (pga) in oracle?

818


Explain the use of online redo log files in oracle.

761


when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.

1680


How to get a create statement for an existing table?

726