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
How do you rank data in sql?
what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba
What is an oracle stored procedure?
What type of database is cloud sql?
what are the different index configurations a table can have? : Sql dba
Do prepared statements prevent sql injection?
What does sql stand for?
Does a join table need a primary key?
What is time based sql injection?
write an sql query to get third maximum salary of an employee from a table named employee_table. : Sql dba
What are the ddl commands?
what is the difference between cluster and non cluster index? : Sql dba
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
List the ways to get the count of records in a table?
What are the parameter modes supported by pl/sql?