How to read 2nd highest sal from EMP table?

Answer Posted / arnab bhui

Using Oracle........

create table emp
( id number(10),
sal numeric(10,5)
);

SQL> select max(sal) from (( select sal from emp ) minus ( select sal from emp where sal >= all ( select sal from emp )));

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the microsoft sql server delete command? : SQL Server Architecture

577


What is a subquery in a select query statement in ms sql server?

580


how would you improve etl (extract, transform, load) throughput?

540


Which is the main third-party tool used in sql server?

476


What does man by sql wildcard characters in sql server?

517






How do we Backup SQL Azure Data?

86


What is tablesample?

570


What is difference between views and stored procedures?

507


How to create a trigger for insert only?

598


How many categories of functions based their return modes?

592


What is the difference between a function and a trigger?

571


Explain syntax for dropping triggers?

515


Are null values the same as that of zero or a blank space?

572


When is the use of update_statistics command?

552


What are the purpose of Normalisation?

636