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 / gautam

select ename,sal from emp
where sal in (select max(sal) from emp group by deptno)
and deptno in (10,20)

Gautam

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is stored procedure faster than query?

922


How do I tune a sql query?

955


How is indexing done in search engines?

955


Are subqueries faster than joins?

971


Mention what does plv msg allows you to do?

1079


explain the options of myisamchk to improve the performance of a table. : Sql dba

973


Does mysql_real_escape_string prevent sql injection?

925


Which normal form is best?

915


Is nosql faster than sql?

982


What is the use of partition by in sql?

956


what is cursor. write example of it. What are the attributes of cursor.

1339


Which are the different character-manipulation functions in sql?

1017


Which certification is best for sql?

954


what is a constraint? : Sql dba

1117


How do you update a value in sql?

1007