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 / gayathri

Sel Empname,deptid, (qualify row_number() over (partition by deptid order by sal asec)=1) as min_sal, (qualify row_number() over (partition by deptid order by sal desc)=1) as max_sal from EMP

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In BTEQ, how are the session-mode parameters being set?

657


What is the function of parser component in teradata?

621


What do you mean by teradata sql assistant?

594


any one answer me how they can analyzing the project using data ware housing?

2032


Can we have two time dimensions in a schema(either star or snow flake)? For ex if we want joining date of employee and if we want today's sales with time whether can we have two time dimensions for accommodating above tasks?

1624






What are the available join types in teradata?

599


Is it necessary to add? Quit statement after a bteq query when I am calling it in a unix environment?

654


How is MLOAD Client System restarted after execution?

604


What are the 5 phases in a multiload utility?

617


Can we collect statistics on table level?

606


Explain the term 'row' related to relational database management system?

534


Did you write stored procedures in teradata?

621


Highlight a few of the advantages that ETL tools have over Teradata.

613


Explain fastload in teradata?

603


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 ?

1900