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

How is MLOAD Teradata Server restarted after execution?

1171


What is meant by Teradata Gateway?

1007


What is the meaning of Caching in Teradata?

1082


Explain parsing engine in teradata?

1026


Comment whether bottleneck is an error or not.

1074


What are differences between teradata and ansi session modes in teradata?

1096


What are the different table types supported by teradata?

896


What is smp and mpp platforms?

903


Explain the term 'foreign key' related to relational database management system?

959


How you will check the version of teradata?

1080


How do you verify a complicated sql?

1014


Difference between stored procedure and macro?

1112


Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?

1904


Highlight the limitations of TPUMP Utility.

1050


What is primary index and secondary index?

975