Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Transposing rows to columns
pallavi.jayanti_at_gmail.com wrote:
> Dear readers,
>
> I have data in 2 tables in the following manner:
>
> Table A:
>
> Source_Code BU_SET_ID Account_Number
> ALS 3 1415999
> ALS 1 1415999
>
>
> Table B:
>
> BU_SET_ID BU_type BU_Code
> 1 LOB TEST
> 3 REICO SURP
>
> I need the o/p to look like:
>
> Source_Code Account_Number LOB REICO
> ALS 1415999 TEST
> SURP
>
> Any help is appreciated.
Use DECODE or CASE. Demos of cross-tabulation are present in Morgan's Library at www.psoug.org under DECODE.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Tue Jul 25 2006 - 02:56:12 CDT