sam2929
asked on
flatten the table
Hi,
I have records coming like below i want to flatten them out.
source looks like:
emplid rcd disable_cd disable_desc
123 1 23 ear infection
123 1 42 broken hand
123 1 16 aa
234 2 11 bb
234 2 16 kk
How can i flatten it based upon emplid rcd
Target should be:
emplid rcd disable_cd_1 disable_cd_2 disable_cd_3 disable_cd_4 disable_desc_1 disable_desc_2 disable_desc_3 disable_desc_4
123 1 23 42 16 null ear infection broken hand aa null
234 2 11 16 null null bb kk null null
I have records coming like below i want to flatten them out.
source looks like:
emplid rcd disable_cd disable_desc
123 1 23 ear infection
123 1 42 broken hand
123 1 16 aa
234 2 11 bb
234 2 16 kk
How can i flatten it based upon emplid rcd
Target should be:
emplid rcd disable_cd_1 disable_cd_2 disable_cd_3 disable_cd_4 disable_desc_1 disable_desc_2 disable_desc_3 disable_desc_4
123 1 23 42 16 null ear infection broken hand aa null
234 2 11 16 null null bb kk null null
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
col emplid for 999 -- assuming emplid can never be more than 3 digits , set other columns similarly
set pages 200 -- Number of lines in a page
Reference :
http://docs.oracle.com/cd/B19306_01/server.102/b14357/ch12040.htm