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
Difference between star and snowflake schemas?
Why does varchar occupy 2 extra bytes?
Let us say there is a file that consists of 100 records out of which we need to skip the first and the last 20 records. What will the code snippet?
how many modules are there in telecome domain?how to explain the architecture?
What is meant by a Parsing Engine?
How will you solve the problem that occurs during update?
What is a node in teradata?
What is multi insert?
In Teradata, how do we Generate Sequence?
Highlight a few of the important components of Teradata?
What is the opening step in basic teradata query script?
What is logical data model?
What is the purpose of using case expression in teradata?
how do you manage the production space. what are the proactive methods you can take ?
During the Display time, how is the sequence generated by Teradata?