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

SELECT ename FROM emp WHERE sal =(SELECT MAX(sal) FROM emp
WHERE deptno=10)
UNION
(SELECT ename FROM emp WHERE sal =(SELECT MAX(sal) FROM emp
WHERE deptno=20))

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

explain mysql aggregate functions. : Sql dba

990


What is the use of triggers?

1037


Can we use joins in subquery?

1164


How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

2170


What are string functions in sql?

1241


Can we use having without group by in sql?

982


How do you change a value in sql?

1019


Why we use joins in sql?

982


GLOBAL TEMPORARY TABLE over Views in advantages insolving mutating error?

3050


Does sql view stored data?

958


How can I see all tables in sql?

1077


Explain the difference between triggers and constraints?

975


How to run sql statements through the web interface?

1041


Which normal form is best?

948


when MSQL8.0 is in market

2076