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
What is the difference between union and union all in teradata?
What is meant by a Channel Driver?
How to view every column and the columns contained in indexes in teradata?
What are different table types used in teradata?
What are the various indexes in teradata?
What are the steps to create a data model?
What are the main components of teradata system?
What is the basic syntax for teradata select statement?
How many types of joins are there in teradata?
Define views in teradata with syntax.
What are the different table types that are supported by teradata?
Explain fastload in teradata?
Define views in teradata with general syntax.
Can you connect multiload from ab initio?
Difference between multiload and tpump?