Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003
    Posts
    1,074

    Unanswered: 'Rotating' a table

    I've been in situations where I have to convert

    ID AMT
    A 123
    A 456
    B 789

    into

    ID AMT1 AMT2
    A 123 456
    B 789

    but how do you perform the reverse? Is there an easier way than using union queries:

    select id, amt1
    from table
    union all
    select id, amt2
    from table

    We have 50 AMT(n) fields in a table, and it seems like there's got to be a better way.

    Thanks,
    Chuck

  2. #2
    Join Date
    Dec 2003
    Posts
    1,074
    I found the following:

    http://www.dbforums.com/t1007070.html

    Sorry for repeating questions that have been asked before. When I tried the search function in this forum before, I clicked on Search This Forum and it just took me to the bottom of the page. I just noticed today that if you click on the arrow to the right of the hyperlink, the search window opens and allows you to enter your search string.

    Took me long enough to figure out. Sheesh.

    Thanks,
    Chuck

Posting Permissions

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