Results 1 to 3 of 3

Thread: Convert columns

  1. #1
    Join Date
    Jun 2004
    Posts
    39

    Unanswered: Convert columns

    Hi,
    I have some data in one table.
    I need to get the data in the same table, into different rows.
    I mean to say that, I have data like
    InvNo InvAmt GstAmt
    12 1900 79

    and I need to get data like

    InvNo Amt
    12 1900
    12 79

    Can anyone help me as to how can i get data in this format.

    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    SELECT InvNo, InvAmt AS AMT
    UNION ALL
    SELECT InvNo, GstAmt AS AMT

    ?????????????????????????????????
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Mar 2004
    Posts
    5
    1. Create a second dummy table with the format that you want.
    2. Transfer the data to the new table
    3. Delete the original table
    4. Rename the dummy table to the original name

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •