Hi All,
can anybody help me on this below.
1)I have a source below.
a
a
a
b
b
c
c
I need output like below.
a1
a2
a3
b1
b2
c1
c2
2)
src:
a
b
a
b
c
d
I need the result should be as non duplicate values like below.
c
d
Thanks,
Nag
Plz help me on below tech tip
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 4
- Joined: Wed Sep 08, 2010 10:57 am
What is your source? Whether it is Database (Oracle / DB2) or Flat file.
If it is Database then you can handle at Database itself by using the below queries.
1. select col||row_number() over(partition by col order by col) from yourtable;
2. select col from yourtable group by col having count(col) <=1;
The above queries are work for Oracle if your database is DB2 then simulate accordingly.
If it is Database then you can handle at Database itself by using the below queries.
1. select col||row_number() over(partition by col order by col) from yourtable;
2. select col from yourtable group by col having count(col) <=1;
The above queries are work for Oracle if your database is DB2 then simulate accordingly.
Cheers
Ravi K
Ravi K
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
(1) Sort and partition data using Sort stage generating key change column then use stage variables to increment/reset counter depending on whether a change has occurred.
(2) Fork join. Make a copy of your data (Copy stage) and run it through an Aggregator to count the rows for each group. Downstream of that join the two streams then filter based on count = 1.
(2) Fork join. Make a copy of your data (Copy stage) and run it through an Aggregator to count the rows for each group. Downstream of that join the two streams then filter based on count = 1.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 47
- Joined: Thu Dec 09, 2010 4:37 am