From an Employee table, how will you display the record
which has a maximum salary?
Answer Posted / pradeep
To get nth rank salary or max salary two ways
below 5th
select ct , empno, sal from (SELECT max(rownum) ct , empno,
sal FROM emp group by empno, sal ORDER BY sal desc) where
ct =5;
below 2nd
select * from (
SELECT DEPTNO,ENAME,SAL,COMM,
RANK() OVER ( ORDER BY SAL DESC, COMM) poK from emp)
where pok =2;
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Why do we use view in sql?
what is collation? : Sql dba
what is the difference between truncate and drop statements? : Sql dba
How is pl sql different from sql?
what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?
What is the primary key?
What is vector point function?
Can unique keys be null?
What are tables and fields in the database?
What are the two types of cursors in pl sql?
Does truncate remove indexes?
What are the advantages of sql?
What are the types of keys?
What is compute?
What is the use of index in hive?