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 the difference between union and union all in teradata?

1133


What is meant by a Channel Driver?

1256


How to view every column and the columns contained in indexes in teradata?

1059


What are different table types used in teradata?

1049


What are the various indexes in teradata?

1057


What are the steps to create a data model?

1066


What are the main components of teradata system?

1143


What is the basic syntax for teradata select statement?

1052


How many types of joins are there in teradata?

980


Define views in teradata with syntax.

1085


What are the different table types that are supported by teradata?

1011


Explain fastload in teradata?

1116


Define views in teradata with general syntax.

1039


Can you connect multiload from ab initio?

1227


Difference between multiload and tpump?

1120