I have one table :EID,Depid,ename,sal
I want to have max(sal) in each department.
Answers were Sorted based on User's Feedback
Answer / omar
select e.department_id,max(e.salary)
from employees e
group by e.department_id
order by e.department_id desc;
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / vengalrao
Dear Friends,
Depends upon table u can pick one max value is possible,one
table u cannot pick max value of all columans , then u can
refer one any ne column
select depid,max(sal) from <table name> group by depid;
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / narasimha
select e.eid,e.sal,e.depid,e.ename,e.sal from emp e
where 1>(select count(*) from emp w where e.sal<w.sal and
e.depid=w.depid) order by e.deptno asc
| Is This Answer Correct ? | 0 Yes | 3 No |
Answer / venkat
select * from emp_test where sal IN(select max(sal) from
emp_test group by deptno)
| Is This Answer Correct ? | 1 Yes | 6 No |
What is a package ? What are the advantages of package ?
Illustrate how to determine the amount of physical CPUs a Unix Box possesses (LINUX and/or Solaris).
How to write a left outer join with the where clause in oracle?
What is the use of oracle?
which clause we are not used in where clause?
Explain oracle data types with examples?
How do you find out from the RMAN catalog if a particular archive log has been backed-up?
what is the maximum number of indexes i can create for a table? What happens if i create indexes for all the columns of a table? Will it slow down the speed of retrieval
What is concurrency in oracle?
What happens if you lost a data file?
What is enter substitution variable in oracle?
How to use fetch statement in a loop?