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
Can there be 2 primary keys in a table?
How do you use join?
What is nosql example?
What are the set operators in sql?
What is a nested table in word?
How does rowid help in running a query faster?
Why should I use postgresql?
Why join is faster than subquery?
Why are aggregate functions called so?
Does inner join return duplicate rows?
What is oracle sql called?
Why partition by is used in sql?
Can we use insert statement in function?
How many types of literals are available in pl sql?
how to dump a table to a file with 'mysqldump'? : Sql dba