Link to home
Start Free TrialLog in
Avatar of sam2929
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
Avatar of Abhimanyu Suri
Abhimanyu Suri
Flag of United States of America image

set lines 200 -- to put o/pin single line limiting to 200 character

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
SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial