How to convert columns of record into multiple rows

Hi,
I have the following data:
Col1 Col2 Col3
Dat1 Dat2 Dat3
I would like to convert the above data into:
Col1
Dat1
Dat2
Dat3
How can I achieve this beside using UNION?
Appreciate advise urgently.
Thanks and Regards,
Shiau Chin

Sorry, I misread your reqs. Is this what you are looking for:
with t as (
           select 'Row1Dat1' col1,'Row1Dat2' col2,'Row1Dat3' col3,'Row1Dat4' col4 from dual union all
           select 'Row2Dat1' col1,'Row2Dat2' col2,'Row2Dat3' col3,'Row2Dat4' col4 from dual
select  col4 col1,
        case lvl
          when 1 then col1
          when 2 then col2
          when 3 then col3
          else col4
        end col2
  from  t,
        (select level lvl from dual connect by level <= 3)
COL1     COL2
Row1Dat4 Row1Dat1
Row2Dat4 Row2Dat1
Row1Dat4 Row1Dat2
Row2Dat4 Row2Dat2
Row1Dat4 Row1Dat3
Row2Dat4 Row2Dat3
6 rows selected.
SQL> SY.

Similar Messages

  • How to make a single recording into multiple songs garageband

    I recorded my band's gig the other night using my Zoom H2 recorder.  I want to take the single 1.5 hour recording (12songs) and make it into a CD with 12 individual tracks.  I would like to use garageband so i can edit out the deadtime between songs but I don't know how to make a CD.

    johndmalone wrote:
    I want to take the single 1.5 hour recording (12songs) and make it into a CD with 12 individual tracks
    http://www.bulletsandbones.com/GB/GBFAQ.html#chaptertocdtracks
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How do you insert new records into multiple tables using the same unique primary key?

    I’ve created a PHP site and MySQL server using a free app called XAMPP.  I have successfully created a form in Dreamweaver that will write data to a (name) table in the SQL database.  Here’s my question: How do you write to two (or more) tables in the same database and pass the same primary key to both tables?  In the SQL database, I defined the first field as ID and set it as the primary key with auto update.  So, when you insert a new record, it creates a unique primary key for that record.  In my form, I’m capturing info that needs to be stored to two tables at the same time; a Name table and Address table. Since the Name and Address tables use the ID field as the primary key, I believe I will need to pass the ID value from the Name table to the insert of the Address table to insure they both have the same primary key, right?

    No. You probably need the primary key from one table to be a foreign key in the other tables. In any case, I believe you can use two methods to obtain the auto generated key. First with SQL:
    http://dev.mysql.com/doc/refman/5.0/en/getting-unique-id.html
    And the other using a PHP function:
    http://us3.php.net/mysql_insert_id

  • Spliting a record into multiple rows

    Hi experts, need your help for your to frame a query for the below requirement
    Scenario 1
    For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that group.
    If minimum then select that record alone as shown below
    Item      DC     Store     Serviceare Bgn Date     Service Area End date     Priority
    9856698     1469     2952     3/5/2011     12/31/9999     100
    9856698     3107     2952     12/10/2011     8/3/2012     35
    Item      DC     Store     St Date     End date     Priority
    9856698     3107     2952     12/10/2011     8/3/2012     35
    Scenario 2
    For a same store fetch the record with least priority (35) and check if the Servicearea begin date & Servicearea end date of that store is minimum for that group.
    If not minimum split the records for that group as shown below and select the record which has the lowest priority(35) and with minimum startdate and end date range.
    Item      DC     Store     Serviceare Bgn Date     Service Area End date     Priority
    9856698     1469     2952     3/5/2011     12/31/9999     35
    9856698     3107     2952     12/10/2011     8/3/2012      100
    Item      DC     Store     St Date     End date     Priority
    9856698     1469     2952     3/5/2011     12/9/2011     35
    9856698     3107     2952     12/10/2011 8/3/2012     100
    9856698     1469     2952     8/4/2012     12/31/9999     35

    There is a seperate forum for SQL and PL/SQL.
    You need to post this at :
    PL/SQL
    And mark this thread as answered if possible.

  • Convert one record row into multiple rows

    Hi,
       I have small requirement.I have selected one data base record into an internal table.Now internal table has 1 record i.e 1 row(ex: 10 columns). Now i will convert this single row record into multiple  records i.e 10 rows( 10 columns wil; be converted into 10 rows). How i will convert this. Please give me any idea on this.
    Regards
    Geetha

    Hi Geetha,
    Search SCN using keyword,  " convert Rows into columns" or vice versa,,,
    U will get more answers & solutions,
    Look at Some of the Previous threads....
    Re: How to create a structure of itab as rows as colums and columns rows dy
    Re: Transpose rows and columns
    CONVERT ROWS INTO COLUMNS IN INTERNAL TABLE
    Convert Internal table Rows into columns of another internal table
    how to convert columns of an internal table to rows of another internal tab.
    Convert Columns into Rows (internal tables) - Urgent Help Pleasse..
    converting columns to rows
    Thanks & regards,
    Dileep .C

  • Displaying single value (Record) into multiple columns

    Hi All,
    I want to display the single record into multiple columns. Please let me know How to achieve this..
    Record:
    Lvl Activity Acre
    6 Week 4 (Same value to be displayed into 3 columns.)
    REquired output:
    lvl Activity PH1 PH2 PH3
    6 Week 4 4 4
    Thanks
    Kavi

    user533671 wrote:
    Hi,
    Thanks for immediate reply.
    PH1, PH2, PH3, ... will go more columns based on parameter , what we are passing.An single SQL statement cannot have a dynamic number of columns based on the data itself. The projection (columns returned) have to be known before any data is fetched... and that includes some 'parameter' value.
    {thread:id=2309172}
    You can build a query dynamically, based on a parameter or even on the data, but 99 times out 100 people use dynamic queries where they are not needed.
    Perhaps explain to us what you are really trying to achieve and why, and we could suggest some better way.

  • How to retrive one table records into another table by multiple records

    how to retrive table X records into another table Y by multiple records (means at once i want display 10 records) in form 6i .
    when i am written cursor it is ftching only one record.But i want to display all records at once.
    Declare
    Cursor cur_name is
    select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae WHERE PROTOCOL_NO='KP229';
    Begin
    open cur_name;
    loop
    fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
    exit when cur_name%notfound;
    next_record;
    end loop;
    close cur_name;
    End;

    Hi,
    Make sure the cursor is in the detailed block. For that use 8GO_BLOCK* built-in. So the code will be
    Declare
    Cursor cur_name is
    select PROTOCOL_NO,DOCNUM,SUBSETSN,REPEATSN,AESEQ,AETERM from coding_ae;
    Begin
    GO_BLOCK('<detailed_block_name>');
    open cur_name;
    loop
    fetch cur_name into :PROTOCOL_NO,:DOCNUM,:SUBSETSN,:REPEATSN,:AESEQ,:AETERM;
    exit when cur_name%notfound;
    next_record;
    end loop;
    close cur_name;
    End;Regards,
    Manu.
    If my response or the response of another was helpful or Correct, please mark it accordingly

  • How to convert columns into rows using  transpose function

    Hi
    anybody tell me how to convert columns values into rows using transpose function.

    Since BluShadow went to all the trouble to put it together, someone should use it.
    See the post titled How do I convert rows to columns? here SQL and PL/SQL FAQ
    John

  • Split a record into multiple records

    Hi,
    I have situation where i need to split a record into multiple records.
    InputData :
    value|BeginDate |EndDate
    15 |2002/10/15|2002/10/16
    13 |2002/10/13|2002/10/20
    19 |2002/10/19|2002/10/23
    10 |2002/10/10|2002/10/12
    OutPut :
    10 |2002/10/10|2002/10/12
    13 |2002/10/13|2002/10/15
    15 |2002/10/15|2002/10/16
    13 |2002/10/16|2002/10/19
    19 |2002/10/19|2002/10/23
    Thanks

    Hi ,
    As a far I understood from your example ,
    I have few questions...
    1. You have information about the patient in a 1 source table.
    2. how u are identifying for patient X u need 5 rows to be created. R u storing these informations in seprate table or how ...
    3. if you have these information in a seperate tables ..... a simple cross join in ODI should get you the expected result.....
    Or give some more information with a example ..that would be great ...
    Thanks

  • Splitting of a CSV File with Multiple Records into Multiple XML File

    Dear All,
    <b> I am doing a Scenario of CSV to XML Files. I am using BPM for the same. My incoming CSV File has got multiple records. I want to break this Multiple records into Multiple XML Files having one record each.</b>
    Can someone suggest how can I break this rather Split this into Multiple XML Files.
    Is Multimapping absoltely necesaary for this. Can't we do this without Multimapping. Can we have some workaround in the FCC parameters that we use in the Integration Directory.
    Kindly reply ASAP. Thanks a lot to all in anticipation.
    Pls Help.
    Best Regards
    Chakra and Somnath

    Dear All,
    I am trying to do the Multimapping, and have 0....unbounded also. Someways it is not working.
    <b>
    Smitha please tell me one thing...Assigning the Recordsets per Message to 1, does it mean that it will write multiple XML Files as I want.</b>
    Also I am usinf Set to Read only. So once the File is read it becomes RA from A. Then will it write the other Records.
    I have to use a BPM because there are certain dependencies that are there for the entire Process Flow. I cannot do without a BPM.
    Awaiting a reply. Thanks a lot in anticipation.
    Best Regards
    Chakra and Somnath

  • Urgent: How to break 1 Row into Multiple Rows

    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product Sub Product Name Age
    New Car Nissan Tom 49
    New Car Nissan Jack 36
    Old Car Audi Sam 24
    Old Car Jaguar Pint 26
    Old Car Audi Smith 41
    I need to be able to fetch the above data in the below fashion
    Product Sub Product Name Age
    New Car
    Nissan
    Tom 49
    Jack 36
    Old Car
    Audi
    Sam 24
    Smith 41
    Jaguar Pint 26
    Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!

    user9086775 wrote:
    Hi Experts,
    I have a requirment where i need to fetch parts of a single row into multiple rows from a singlt Query, i am sure it is possible using Pivots but just cant figure out an approach. Any help on this is highly appriciapted.
    Requirment:
    This is a sample set record in a table
    Product     Sub Product          Name    Age
    New Car    Nissan                   Tom        49
    New Car    Nissan                   Jack         36
    Old Car      Audi                     Sam         24
    Old Car      Jaguar                  Pint          26
    Old Car      Audi                     Smith       41
    I need to be able to fetch the above data in the below fashion
    Product     Sub Product          Name    Age
    New Car
    Nissan
    Tom        49
    Jack        36
    Old Car     
    Audi            
    Sam        24
    Smith      41
    Jaguar                   Pint         26Please help with ideas as to how can i achive the above without using PLSQL.
    Thanks in advance!You should be doing this in the client on not in the DB. Use the reporting tool that you use to do this.
    For example if you are in SQL Plus you can use the BREAK command.

  • Splitting comma seperated column data into multiple rows

    Hi Gurus,
    Please help me for solving below scenario. I have multiple value in single column with comma seperated values and my requirement is load that data into multiple rows.
    Below is the example:
    Source Data:
    Product         Size                                 Stock
    ABC              X,XL,XXL,M,L,S                 1,2,3,4,5,6
    Target Data:
    Product         Size                                 Stock
    ABC              X                                     1
    ABC              XL                                   2
    ABC              XXL                                 3
    ABC              M                                    4
    ABC              L                                      5
    ABC             S                                        6
    Which transformation we need to use for getting this output?
    Thanks in advance !

    Hello,
    Do you need to do this tranformation through OWB mapping only? And can you please tell what type of source you are using? Is it a flat file or a table?
    Thanks

  • How do I separate a PDF into multiple PDFs using Adobe PDF Pack?

    How do I separate a pdf into multiple pdfs using AdobePack?
    [Title edited to reflect actual product name... Mod]

    I do not find "AdobePack" when I look at the list of forums https://forums.adobe.com/welcome
    What is the exact name of the program you are using... Acrobat, or are you using the online version at Acrobat.com?
    ADDED... found Adobe PDF Pack (read only) so will move this message

  • How to convert a PDF file into a full editable WORD file?

    Hi,
    I tried to convert a pdf file into word but it is not fully editable. I can edit the title from the main page and that's it. The rest of the word document is saved as image. I tried editing teh pdf file but that one is not working either.
    Please help on how to convert a PDF file into a full editable WORD file.
    Thank you

    Not all PDF files are created equal.  When a PDF file is created with Adobe Tools it is usually "tagged" with information about the fonts the images, the layout etc...    This way when the PDF is saved to a new format like PPT or DOC then the results are usually usable.  However, if you have a PDF file that was not tagged for some reason then run the Accessibility tools on the PDF to acquire some basic tagging.  This may get you a better result.  Also if you have a PDF that is an image, then you may want to run OCR on it.

  • How to convert my MM alias into an AppleID to use it with iCloud?

    I used MobileMe and created a mail that became my Apple ID. Then I created an alias that became my main e-mail so now with iCloud I wish that aslias could become my Apple ID. I don't care to loose the first Apple ID but "How to convert my MM alias into an AppleID to use it with iCloud?"

    You cannot convert an alias to Apple ID.
    You can transfer your MM to iCloud with your main Apple ID.
    There will be your alias as well.
    Regards

Maybe you are looking for

  • Can't print from MAC on network

    HP PSC 1410 connected to a Lenovo running Windows Vista.  Printer is shared on the network.  Print job from MAC gets into print queue on Vista machine.  Status goes from Spooling to Printing but then goes to Error - Printing.  Can print from other Wi

  • MRP - project stock - safety stock

    Hello, My MRP plans on a project stock. When I try to fill in the field "safety stock" in material master data MRP plans the safety amount on unrestricted use stock. I would like it to be planned on a specified project. Do you know how to do it? Best

  • My Recordset is not showing up in the Panel

    What do I need for the recordset to show up in the Dreamweaver Bindings Panel? I have a recordset working but it does not show up in the panel and I want to use some DW behaviors.

  • MacBook Pro App HELP!!

    I have purchase adobe photoshop, but have a new mac.  when I go to purchases it has an option to "install" but it won't let me install it.  Any ideas how to fix this?

  • Why do I see "FAILED" for probes on standby ACE?

    Here there, I am running a pair of ACE in redundancy mode for HA and have created multiple context. here is my basic config for the serverfarm. serverfarm host VPN_Farm   transparent   failaction purge   predictor leastconns   probe ICMP_Probe   rser