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
What is the difference between partition and index?
How can I make sql query run faster?
What are all the different normalizations?
What are reports usually used for?
What is the difference between microsoft sql and mysql?
What are the advantages of pl sql?
what are null values? : Sql dba
What is difference between procedure and trigger?
Is sql considered coding?
What are the popular database management systems in the it industry?
What is composite primary key in sql?
What is flag in sql?
Explain the types of joins in sql?
How do I save the results of sql query in a file?
Is left join faster than join?