Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2002
    Posts
    58

    Unanswered: pivoting a recordset

    I have a reference table that looks like this

    id | value
    ==========
    1,abc
    1,def
    1,ghi
    2,def
    2,jkl

    I want these values to go horizontally into another table matched on id, to look like this:

    id | value
    ========
    1,abc def ghi
    2, def jkl

    I built a cursor to parse through it but was taking forever (there's 185,000 records in the reference table). Any idea's on the fastest way to perform this function?

  2. #2
    Join Date
    Feb 2002
    Posts
    58
    never mind, I added an index to the destination table and it finished in 24 seconds

Posting Permissions

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