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

Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 10 order by sal desc) a where
rownum < 2
union
Select emplid, sal from (select emplid, sal from
emp_sal_tbl where deptid = 20 order by sal desc) a where
rownum < 2

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you update sql?

955


What are % type and % rowtype?

1021


Show the two pl/sql cursor exceptions.

1167


Can we rollback truncate?

986


What is difference between db2 and sql?

982


what is sql in mysql? : Sql dba

1176


Can we write ddl statements in functions?

1095


What are sql functions? Describe the different types of sql functions?

1122


What is difference between stored procedures and application procedures?

995


What are tables in sql?

1042


Can a procedure in a package be overloaded?

1029


Why use subqueries instead of joins?

1066


Which language is used in sql?

1041


What are transaction and its controls?

1022


What does joining a thread mean?

1004