how to get second highest salary in SQL(as/4000

Answer Posted / amedela chandra sekhar

SQL> select * from emp where sal=(select max(sal) from emp
2 where sal<(select max(sal)from emp));

EMPNO ENAME JOB MGR HIREDATE
SAL COMM
---------- ---------- --------- ---------- ---------
---------- ----------
DEPTNO
----------
7788 SCOTT ANALYST 7566 19-APR-87 3000
20

7902 FORD ANALYST 7566 03-DEC-81 3000
20

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I call a procedure inside a function?

556


How do I make my sql query run faster?

470


What version is sql?

555


What is pl sql script?

566


How to select all records from the table?

613






What is difference between ms sql and mysql?

479


What are the different types of dbms?

556


Define sql delete statement.

572


Which sql statement is used to delete data from a database?

469


How much does sqlite cost?

562


what is commit? : Sql dba

619


What are different types of functions in sql?

513


How many row comparison operators are used while working with a subquery?

543


what are the 'mysql' command line options? : Sql dba

561


What is program debugging?

572