Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



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

Answer / sunil

select depid,max(sal) from <table name> group by depid;

Is This Answer Correct ?    33 Yes 4 No

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

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

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

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

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

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

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

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

Post New Answer

More Oracle General Interview Questions

How to count groups returned with the group by clause in oracle?

0 Answers  


What is a cursor in oracle?

0 Answers  


How can I combine multiple rows into a comma-delimited list in oracle?

0 Answers  


write a query to count number of alphabets in given string for example "APPLE" write a query to generate sequence from 50 to 100 write a query to display in single string "ABCD,EFGH,IJKL,PQRS"

7 Answers   British Telecom BT,


Can a Tablespace hold objects from different Schemes ?

3 Answers  


How to use "for" statements in oracle?

0 Answers  


What do you mean by merge in oracle?

0 Answers  


How to retrieve data from an cursor to a record?

0 Answers  


What to do if the startbd.bat failed to start the xe instance?

0 Answers  


What is ordinary table in oracle?

0 Answers   MCN Solutions,


How to define an oracle cursor variable?

0 Answers  


What is Database Buffers ?

1 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)