Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    102

    Unanswered: Sql Query. Help Please.

    Dear All,

    I have a record like this.......

    sl------C1------c2-------val
    ===========================
    01-----AA------BB-------2500


    I need the above in the following

    sl-------code-----val
    ==================
    01------AA-------2500
    01------BB-------2500

    I need your help ...............Pls
    Working Together...

  2. #2
    Join Date
    Nov 2003
    Posts
    2,933
    Provided Answers: 12
    Code:
    SELECT sl, c1 as code, val
    FROM the_table_with_no_name
    WHERE c1 = 'AA'
    UNION ALL
    SELECT sl, c2, val
    FROM the_table_with_no_name
    WHERE c2= 'BB'
    You should fix your database design

  3. #3
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    Code:
    select sl, c1, val || chr(13) || chr(10) || sl, c2, val
    from table_with_no_name;
    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
  •