Page 1 of 1

How to find max sal using remove duplicate stage

Posted: Mon Mar 26, 2012 1:06 am
by nravikrishna
hi frds i have one question how to find max sal using remove duplicate stage
i have data like

deptno,sal
10,1300
20,1100
30,1200
20,1200
10,1000
30,1600
30,1500

Ans:
10,1300
20,1200
30,1600

please send me to personal email mail2 <removed>

Posted: Mon Mar 26, 2012 5:22 am
by chulett
Several things need to be said here before your question gets answered.

1. Welcome.
2. When you have a question, start a new post. Please don't just reply to whatever post you happen to be reading at the time.
3. I split yours out to the above noted post of your own.
4. Because of that, I had to guess OS and Version. Fix those if they are wrong.
5. Answers do not get sent to personal email, they go here. You can get notifications of a reply via email, however.

Posted: Mon Mar 26, 2012 5:28 am
by chulett
Sort in the proper order and then keep first or last, depending on said order. Hash partition if running on multiple nodes. Of course, you could also use an Aggregator but that wasn't the question. :wink:

Re: How to find max sal using remove duplicate stage

Posted: Mon Mar 26, 2012 3:08 pm
by ray.wurlod
nravikrishna wrote:to find max sal using remove duplicate stage
That's like asking how to join water pipes using a screwdriver. What ever happened to "the right tool for the right job"? Why using this particular stage type, whose function - I should not have to say - is NOT about finding maximum values.

Re: How to find max sal using remove duplicate stage

Posted: Tue Mar 27, 2012 1:47 am
by lannguyen
Remove duplicate :
- key = deptno.
- In the Partition tag: choose Hash on deptno and sort (desc) on sal