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 exactly do you know about catching in teradata?

1082


Why is the case expression used in teradata?

1138


What is the syntax for case when statement?

1220


What are the available primary index types in teradata.

1085


What are the design features involved in teradata?

1119


How to explain project Architecture and flow in teradata interviews?Can please anyone help on this? Am new to teradata.

4425


What happens in a conflict? How do you handle that?

1105


Explain and compare pros and cons of start schemas?

1153


What is the purpose of indexes?

1133


What is upsert statement in teradata?

1195


What are the different design perspectives used in teradata?

1037


how many modules are there in telecome domain?how to explain the architecture?

2068


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

1086


What is primary index and secondary index?

1073


what is sysdba and sysdbc ? which has high priority ?

3888