Answer Posted / kanhu charan biswal
select ename, sal from emp where sal=(select max(sal) from
emp);
For see the max(sal) with ename departmentwise the query
will be:
select ename,sal from emp a
where sal in (select max(sal) from emp group by deptno);
For findout the nth highest salary with name, the query
will be:
select ename,sal from emp a
where &n=(select count(distinct sal) from emp b
where b.sal>=a.sal)
after execute the query it will ask you to pass a value
for 'n'.it stands for nth hiest salary
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
How do I pipe the output of one isql to another?
What is secondary key?
What is form and report?
What is varchar data type in sql?
Differentiate between % rowtype and type record.
What are the types of join and explain each?
What are the most important characteristics of pl/sql?
What is the difference between nested table and varray?
Which is faster truncate or drop?
Which is better join or subquery?
What is the difference between jpql and sql?
What is a data definition language?
Which is better join or inner query?
Mention what does plv msg allows you to do?