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

How many codd's rules are satisfied by teradata database?

1124


What are the scenarios in which full table scans occurs?

1020


What are the functions performed by bynet?

1058


What is the difference between fastload and multiload? Which one is faster?

1244


Did you write stored procedures in teradata?

1146


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

1058


What are the various etl tools in the market?

1085


Explain fallback in teradata?

1074


Mention a few of the ETL tools that come under Teradata.

1100


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

2058


Explain teradata vs. Redshift?

1039


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

971


Describe primary index in teradata. And what are the available primary index types?

1014


How is MLOAD Client System restarted after execution?

1168


What is meant by a Virtual Disk?

1155