Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    83

    Unanswered: How do I flatten a sub-query?

    I have a table that looks like this (two columns; one for name; one for role):

    Bob HR1
    Bob HR2
    Bob HR3
    John HR1
    Greg HR1
    Greg HR2

    What I want is to have the table flattened so my query will output this :

    Bob HR1 HR2 HR3
    John HR1
    Greg HR1 HR2

    When I tried to do a subquery I obviously got the "subquery returns more than one row" error.

    Is flattening the table possible?

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    where rownum < 2
    --YMMV
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    where rownum < 2
    --YMMV
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

Posting Permissions

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