One row into multiple rows
Posted: Tue Dec 02, 2008 3:20 pm
Hi,
Sorry.I dont know how to say..Here i am giving an example of my queastion.
Each columns which has a flag value of '1' or '0' should come as an individual row in the output.
Ex:Input(all feilds are char feilds)
col1 col2 col3 col4 col5 col6
-------------------------------
aa 1 1 1 0 1
bb 0 1 1 1 1
Output should be as(all fields are char)
col1 col2 col3 col4 col5 col6
--------------------------------
aa 1 0 0 0 0
aa 0 1 0 0 0
aa 0 0 1 0 0
aa 0 0 0 0 0
aa 0 0 0 0 1
bb 0 0 0 0 0
bb 0 1 0 0 0
bb 0 0 1 0 0
bb 0 0 0 1 0
bb 0 0 0 0 1
Please any help..
Thanks
Sorry.I dont know how to say..Here i am giving an example of my queastion.
Each columns which has a flag value of '1' or '0' should come as an individual row in the output.
Ex:Input(all feilds are char feilds)
col1 col2 col3 col4 col5 col6
-------------------------------
aa 1 1 1 0 1
bb 0 1 1 1 1
Output should be as(all fields are char)
col1 col2 col3 col4 col5 col6
--------------------------------
aa 1 0 0 0 0
aa 0 1 0 0 0
aa 0 0 1 0 0
aa 0 0 0 0 0
aa 0 0 0 0 1
bb 0 0 0 0 0
bb 0 1 0 0 0
bb 0 0 1 0 0
bb 0 0 0 1 0
bb 0 0 0 0 1
Please any help..
Thanks