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

Can you connect multiload from ab initio?

731


What are the available join types in teradata?

695


How do you see a ddl for an existing table?

667


Give a justifiable reason why Multi-load supports NUSI instead of USI.

791


What do you mean by teradata intelliflex?

711






What is logical data model?

751


How many tables can you join in v2r5?

701


What is meant by a dispatcher?

656


What does sleep function does in fast load?

704


Which is faster fastload or multiload?

675


What are the different softwares used with their functions in teradata?

658


A certain load is being imposed on the table and that too, every hour. The traffic in the morning is relatively low, and that of the night is very high. As per this situation, which is the most advisable utility and how is that utility supposed to be loaded?

789


Backup Script was blocked you are unable to archive the data now. how do you analyze it and where do you identify ?

1702


Why managing the data is important?

663


how can we analyze the locks ?

1779