My scenario :-
My result should be as below
sibhi good bad
Thanks a lot raja !!! but i dont have access to execute function tdstats.udfconcat :( :( Please help me somehow !!!!
I hitting my head for past 2 hours !!!
but i need a generic one which should accomodate even if n number of values and concatenate it into same column.. like below
Sibhi good bad n n n n n n n n n n n n ......
With recursive may take a lot of spool. You can think of udf for concatenation, or you can extend your list above :).
you have not told me the version , you are using.
Sorry Raja ... I am using TD 14 using Teradata Studio Express 15 .
UDF is totally new to me . I looked into Info.teradata.com but i need more help in preparing a UDF for my scenario . Can u pls do any sort of help ?
I hope the below query serve's ur purpose:
SEL name,DESCRIP r FROM(select a.name name,
(CASE WHEN SUBSTR(a.desc1,0,length(a.desc1)+1)<>SUBSTR(b.desc1,0,length(b.desc1)+1) THEN trim(a.desc1)||trim(b.desc1) END) DESCRIP,RANK(DESCRIP) r
FROM YOUR_TABLE a,YOUR_TABLE b
where DESCRIP is not null)x