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

What is difference between inner join and cross join?

730


What are two statement types in sql?

762


What is the difference between left outer join and left join?

715


How do I partition in sql?

711


Does truncate need commit?

703


what is error ora-03113: end-of-file on communication channel?

830


What is a database? Explain

825


What is clause?

807


Which kind of parameters cannot have a default value in pl sql?

815


What is natural join in sql?

720


Describe sql comments?

739


How do sql databases work?

727


Is join same as left join?

761


What is sql constant?

691


What is indexing in sql and its types?

752