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
How to select first n records in teradata?
Highlight the points of differences between the database and user in Teradata.
What are the steps to create a data model?
If Fast Load Script fails and only the error tables are made available to you, then how will you restart?
Why are oltp database designs not generally a good idea for a data warehouse?
What is dimensional modeling?
Explain teradata architecture?
What do you mean by teradata sql assistant?
What is bteq script in teradata?
Difference between inner join and outer join?
Hi send me the Teradata dumps to my id rajeshanantha@yahoo.co.in Thanks Rajesh. A
What are the different functions included in the server software?
How you will check the version of teradata?
Can any one explain me the difference between BTEQ and MLOAD,TUMP. All canbe used for same purpose but still differnt methods. why ?
any one answer me how they can analyzing the project using data ware housing?