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

How would you reference column values before and after you have inserted and deleted triggers?

1037


What is a trigger word?

982


what does the t-sql command ident_incr does? : Transact sql

1032


How many types of keys are there in sql?

1012


Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1172


Which is better stored procedure or query?

940


What is sql injection vulnerability?

891


What is the difference between alter trigger and drop trigger statements?

1067


What is a scalar value in sql?

1031


What are all the ddl commands?

1146


when MSQL8.0 is in market

2037


How do you declare a variable in pl sql?

988


What is forward declaration in pl sql?

1028


How do you define a foreign key?

957


What is secondary key?

898