Results 1 to 5 of 5
  1. #1
    Join Date
    May 2003
    Posts
    34

    Unanswered: How to get this output

    Here is my source data


    COL1 COL2 COL3
    ==== ==== ====
    1 100 777
    2 100 777

    3 100 888
    4 100 888
    5 100 888

    1 100 999
    2 100 999



    I require an output like this

    1,2 777
    3,4,5 888
    1,2 999

    Thanks

  2. #2
    Join Date
    Aug 2004
    Posts
    330
    Are you looking for a 2-column output? First output column -- comma separated values of COL1 results based upon a common COL3 values. Second output column -- the value of COL3 corresponding to the list of values in COL1.

  3. #3
    Join Date
    May 2003
    Posts
    34

    output

    First output column -- comma separated values of COL1 results based upon a common COL3 values.
    Second output column -- the value of COL2
    Third output column -- corresponding to the list of values in COL1.

  4. #4
    Join Date
    Mar 2002
    Location
    Reading, UK
    Posts
    1,137
    Implement the stragg function

    http://asktom.oracle.com/pls/ask/f?p...D:229614022562

    then do

    select stragg(col1), col3
    from x
    group by col3

    Alan

  5. #5
    Join Date
    Jul 2003
    Posts
    2,296
    that is totally awesome.
    thanks for the link
    - The_Duck
    you can lead someone to something but they will never learn anything ...

Posting Permissions

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