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

sel empname, a.deptid, b.salary
from t1_metadata.emp_test a,
(
sel
deptid, max(sal)
from t1_metadata.emp_test
group by 1
union
sel
deptid, min(sal)
from t1_metadata.emp_test
group by 1
)b (deptid, salary)
where a.deptid = b.deptid
and a.sal=b.salary

Is This Answer Correct ?    8 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the enhanced features in teradata v2r5 and v2r6?

1138


What do you mean by tpt in teradata?

1025


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

2054


Differentiate primary key and partition key?

989


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

960


Comment whether bottleneck is an error or not.

1166


If the PMON is not working then how do you identify and monitor all the processes, resources and sessions ?

2207


how do we write scripts in unix how to execute scripts in real time anybody please needfull or give me number i will cal u

1750


What are the various indexes in teradata? How to use them? Why are they preferred?

1069


Is it necessary to add? Quit statement after a bteq query when I am calling it in a unix environment?

1248


What happens when a node suffers a downfall?

1141


Explain the types of join supports by teradata?

997


In a table can we use primary key in one column and in another column both unique and not null constrains.if yes how?

1175


A certain load is being imposed on the table and that too, every hour. The traffic in the morning is relatively low, and that of the night is very high. As per this situation, which is the most advisable utility and how is that utility supposed to be loaded?

1264


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

4560