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

explain the advantages and disadvantages of stored procedure? : Sql dba

1021


What is a scalar value in sql?

1086


What company owns postgresql?

1038


Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

1083


Define a temp table?

1031


Is json a nosql?

985


What are the different types of dbmss?

1021


What is natural join in sql?

1006


Is and as keyword in pl sql?

969


Which command is used to call a stored procedure?

1011


What is indexes?

1063


Is t sql a programming language?

1073


what are the differences between char and nchar? : Sql dba

1122


What is difference between joins and union?

1138


What are aggregate functions in sql?

1171