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 are the steps involved after the disk manager passes the request?
Explain the term 'foreign key' related to relational database management system?
Explain some differences between mpp and smp?
What is the particular designated level at which a LOCK is liable to be applied in Teradata?
Explain the most common data types used in teradata?
Mention the procedure via which, we can run Teradata jobs in a UNIX environment.
What is meant by a node?
What are the various indexes in teradata? Why are they preferred?
Can we have an unconnected lkp to lookup a db2 record against a teradata record? Doesnt seem to work. I could be wrong
What are the different functions included in the server software?
Mention a few of the ETL tools that come under Teradata.
Explain fallback in teradata?
Explain Teradata performance tuning and optimization?
What are the different functions performed in development phase?
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 ?