Page 1 of 1

concatenating same column data

Posted: Fri Feb 11, 2005 3:09 pm
by DSkkk
hi All,
my data is so bad that the emailaddress got split into different rows with all the same other details.
eg:
order_nbr emailaddress seq_id
100 Y, 6
100 DSkkk@yahoo 7
100 .com 8

i have the column seq_id which has the consequent nos for the continuation.
now i have to concatenate the whole email address and discard the remaining rows.
i have done an order by through my SQL query and have all the rows in this fashion in order. now i am to concatenate them when they have all order_nbr same.
can you suggest different ways to do this?

Posted: Fri Feb 11, 2005 4:13 pm
by Sainath.Srinivasan
You can sort the data by the key and seq no. Then you can use stage variables to control the concatenation and pass to next stage on change of key. But note that the last record has to be handled in some way (maybe by obtaining wc -l before job and passing it as a job param).

Posted: Mon Feb 14, 2005 7:55 am
by DSkkk
i did not exactly follow the suggestion. can you explain?
Thanks

Posted: Mon Feb 14, 2005 8:52 am
by Sainath.Srinivasan
Try to concatenate the col.s in an empty hash-file to start.

Read and write into the same hash file.

I explained this method to another post just 2 or 3 above yours.