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 a three-tier data warehouse?
What do you mean by teradata sql assistant?
Give a justifiable reason why Multi-load supports NUSI instead of USI.
Give the sizes of SMALLINT, BYTEINT and INTEGER.
What do you mean by fastexport in teradata?
Why is the case expression used in teradata?
What are the various indexes in teradata?
In BTEQ, how are the session-mode parameters being set?
Why managing the data is important?
Difference between stored procedure and macro?
What is the function of parser component in teradata?
Explain how spool space is used.
What is meant by a Highest Cost Plan?
what are the uses of fact table and dimension table in banking project?
What is teradata?