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 can be achieved by using the teradata rdbms?
How is MLOAD Client System restarted after execution?
Explain teradata vs. Redshift?
Explain the term 'row' related to relational database management system?
Explain teradata architecture in detail with a diagram.
What is a dimension table?
why use references rather than pointers in the public api, particularly for arguments which are modified?
What is teradata and why it is used?
While creating table my dba has fallback or no fallback in his ddl. What is that?
How to find duplicates in a table?
Explain the meaning of Amp?
What do you mean by teradata intellicloud?
How many sessions of MAX is PE capable of handling at a particular time?
What are the commands to make a new table, change a table and remove a table in teradata?
what is sysdba and sysdbc ? which has high priority ?