I have one table :EID,Depid,ename,sal
I want to have max(sal) in each department.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to call a stored function with parameters?

564


Is the After report trigger fired if the report execution fails ?

2404


What are the limitations of check constraint?

573


How to rename a tablespace in oracle?

619


What is set verify off in oracle?

579






What do database buffers contain?

565


What is hot backup and logical backup?

610


What is the usage of merge statement?

672


What is a read only transaction in oracle?

596


What is ordinary table in oracle?

652


if you ctreate table identity

1847


How would you edit your CRONTAB to schedule the running of /test/test.sh to run every other day at 2PM?

1441


How to store pictures on to the database?

532


Are truncate and delete commands same? If so why?

654


How do I use os authentication with weblogic jdriver for oracle and connection pools?

577