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
How is MLOAD Teradata Server restarted after execution?
What is meant by Teradata Gateway?
What is the meaning of Caching in Teradata?
Explain parsing engine in teradata?
Comment whether bottleneck is an error or not.
What are differences between teradata and ansi session modes in teradata?
What are the different table types supported by teradata?
What is smp and mpp platforms?
Explain the term 'foreign key' related to relational database management system?
How you will check the version of teradata?
How do you verify a complicated sql?
Difference between stored procedure and macro?
Backup Script was blocked then you are unable to archive the data. how do you analyze it and where do you identify ?
Highlight the limitations of TPUMP Utility.
What is primary index and secondary index?