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 / hariharan
sel empname, a.deptid, b.salary
from t1_metadata.emp_test a,
(
sel
deptid, max(sal)
from t1_metadata.emp_test
group by 1
union
sel
deptid, min(sal)
from t1_metadata.emp_test
group by 1
)b (deptid, salary)
where a.deptid = b.deptid
and a.sal=b.salary
| Is This Answer Correct ? | 8 Yes | 11 No |
Post New Answer View All Answers
What exactly do you know about catching in teradata?
Why is the case expression used in teradata?
What is the syntax for case when statement?
What are the available primary index types in teradata.
What are the design features involved in teradata?
How to explain project Architecture and flow in teradata interviews?Can please anyone help on this? Am new to teradata.
What happens in a conflict? How do you handle that?
Explain and compare pros and cons of start schemas?
What is the purpose of indexes?
What is upsert statement in teradata?
What are the different design perspectives used in teradata?
how many modules are there in telecome domain?how to explain the architecture?
Briefly explain each of the following terms related to relational database management system (rdbms) – database, tables, columns, row, primary key and foreign key.
What is primary index and secondary index?
what is sysdba and sysdbc ? which has high priority ?