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
Hi Friends, Please send me Teradata Materials for certifications Thanks in advance !!
What do you mean by ttu in teradata?
Can we collect statistics on table level?
What are the steps to create a data model?
Can we have an unconnected lkp to lookup a db2 record against a teradata record? Doesnt seem to work. I could be wrong
How many sessions of MAX is PE capable of handling at a particular time?
How many types of joins are there in teradata?
What is the syntax for case when statement?
Why is the case expression used in teradata?
What do high confidence, low confidence and no confidence mean in explain plan?
Did you write stored procedures in teradata?
Hi, If anyone has TD 14 Basics dumps or study materials, please share. nirmaaal1991@gmail.com
What is dimensional modeling?
Backup Script was blocked you are unable to archive the data now. how do you analyze it and where do you identify ?
What is the difference between global temporary tables and volatile temporary tables?