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 can be achieved by using the teradata rdbms?

980


How is MLOAD Client System restarted after execution?

1054


Explain teradata vs. Redshift?

953


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

886


Explain teradata architecture in detail with a diagram.

1045


What is a dimension table?

981


why use references rather than pointers in the public api, particularly for arguments which are modified?

935


What is teradata and why it is used?

1010


While creating table my dba has fallback or no fallback in his ddl. What is that?

1113


How to find duplicates in a table?

1130


Explain the meaning of Amp?

1032


What do you mean by teradata intellicloud?

972


How many sessions of MAX is PE capable of handling at a particular time?

1030


What are the commands to make a new table, change a table and remove a table in teradata?

1064


what is sysdba and sysdbc ? which has high priority ?

3759