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
Name the five phases that come under MultiLoad Utility.
What are default access rights in teradata?
Explain fallback in teradata?
What is meant by a Least Cost Plan?
What is node? How many nodes and amps used in your previous project?
What are the joins in teradata?
In BTEQ, how are the session-mode parameters being set?
What are the steps involved after the disk manager passes the request?
How teradata makes sure that there are no duplicate rows being inserted when its a set table?
What are the frequently used data types in teradata?
How do you set the session mode parameters in bteq?
Can we collect statistics on multiple columns?
How is MLOAD Client System restarted after execution?
If I wanted to run a TPump job only once per day - basically working on a file that is produced once per day - how would you set up the parameters for that sort of job ?
How to Extract data from multiple legacy systems?