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...

I have a employee table with EMPID, EMPNAME, DEPTID, SAL
and want to fetch the maximum and minimum salary on each
dept id with the emp name. Can anyone help in this? The
result should contain the EMPNAME, DEPTID, SAL.

Answer Posted / ragunath

sel empname,deptid,sal 
from employee where (deptid,sal) in 
(sel deptid, max(sal)from employee group by 1
)
union
(sel empname,deptid,sal 
from employee where (deptid,sal) in 
(sel deptid, min(sal) from employee group by 1
));

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a three-tier data warehouse?

1116


What do you mean by teradata sql assistant?

1063


Give a justifiable reason why Multi-load supports NUSI instead of USI.

1154


Give the sizes of SMALLINT, BYTEINT and INTEGER.

1171


What do you mean by fastexport in teradata?

1003


Why is the case expression used in teradata?

1078


What are the various indexes in teradata?

1050


In BTEQ, how are the session-mode parameters being set?

1143


Why managing the data is important?

1016


Difference between stored procedure and macro?

1173


What is the function of parser component in teradata?

1087


Explain how spool space is used.

1077


What is meant by a Highest Cost Plan?

1063


what are the uses of fact table and dimension table in banking project?

4556


What is teradata?

1151