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 are normalization, first normal form, second normal form and third normal form?

1110


How can we check the version of Teradata that we are using currently?

1110


Difference between multiload and tpump?

1157


Highlight all the modes that are present under Confidence Level.

1011


Explain teradata architecture?

1149


Briefly explain each of the following terms related to relational database management system (rdbms) – database, tables, columns, row, primary key and foreign key.

1081


How to load specific no.of records using bteq, or fastload,or multiload

1816


Different phases of multiload?

1065


Why teradata is used?

1055


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

1189


What is the difference between union and union all in teradata?

1188


How can bottlenecks be identified?

1060


What are teradata utilities?

1155


How you will check the version of teradata?

1223


Explain the term 'row' related to relational database management system?

999