Page 1 of 1

converting rows to columns

Posted: Thu Jul 31, 2008 3:38 am
by chitravallivenkat
Can any one suggest me how to convert rows into column.
i have implemented as max( case.....). but there is problem in executing so plz help me out in this

Re: converting rows to columns

Posted: Thu Jul 31, 2008 3:52 am
by sachin1
please elaborate on what you want and what is your input..........

Re: converting rows to columns

Posted: Thu Jul 31, 2008 4:00 am
by chitravallivenkat
Thanks,

The below is the query :-
max(case when tda.addrs_seq_nbr=1 then tda.orgnl_addrs_ln_txt else null end) orgnl_addrs_ln_1,

will the pivot stage help me out in this..

Posted: Thu Jul 31, 2008 6:53 am
by chulett
That query doesn't really tell us what you are trying to accomplish. Please try to spell out in words what the problem is that you are trying to solve. Forget the "max case" query, just talk to us. Examples of your source data and what it would need to look like in the target are always helpful.