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 are normalization, first normal form, second normal form and third normal form?
How can we check the version of Teradata that we are using currently?
Difference between multiload and tpump?
Highlight all the modes that are present under Confidence Level.
Explain teradata architecture?
Briefly explain each of the following terms related to relational database management system (rdbms) – database, tables, columns, row, primary key and foreign key.
How to load specific no.of records using bteq, or fastload,or multiload
Different phases of multiload?
Why teradata is used?
In BTEQ, how are the session-mode parameters being set?
What is the difference between union and union all in teradata?
How can bottlenecks be identified?
What are teradata utilities?
How you will check the version of teradata?
Explain the term 'row' related to relational database management system?