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...

consider a table which contain 4 columns,ename,eno,sal and
deptno, from this table i want to know ename who having
maximum salary in deptno 10 and 20.

Answer Posted / abhishekjaiswal

select last_name,salary from employees where (salary,department_id) in ( select max(salary),
department_id from employees where department_id in (10,20) group by 
department_id) 
/
Output
LAST_NAME                     SALARY
------------------------- ----------
Hartstein                      13000
Whalen                          4400

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What type of join is sql join?

1022


Can we use commit inside a trigger?

1145


What is indexing oracle sql?

1142


What is sql injection vulnerability?

1005


How do you optimize a stored procedure in sql?

1014


what is msql? : Sql dba

1044


How would you pass hints to the sql processor?

1038


Can we join 3 tables in sql?

1106


Does sql backup shrink transaction log?

1042


Can variables be used in sql statements?

1073


Explain exception handling in pl/sql?

1080


List the ways to get the count of records in a table?

941


What is a function in oracle pl sql?

1096


What are types of exception?

960


Can we rollback truncate?

1049