Results 1 to 2 of 2

Thread: Rows to columns and vice-versa

  1. #1
    Junior Member
    Join Date
    Mar 2008
    Answers
    15

    Rows to columns and vice-versa

    How can you transpose rows to columns and vice versa and what transformations would you choose?
    Pls explain how to do the mapping..


  2. #2
    Contributing Member
    Join Date
    Dec 2007
    Answers
    34

    Re: Rows to columns and vice-versa

    Hi,
    src table:
    eno colname colval
    -------------------
    1000 name prakash
    1000 age 24
    1000 sal 25000
    1001 name srini
    1001 age 21
    1001 sal 25000

    output:
    eno name age sal
    ------------------
    1000 prakash 24 25000
    1001 srini 21 25000

    logic:

    src-------->agg---------->tar
    in agg:

    step 1: create the o/p port, for getting the name of the employee o_name
    iif(colname='name',colval)

    step 2: create the o/p port, for getting the age of the employee o_name
    iif(colname='age',colval)

    step 3: create the o/p port, for getting the sal of the employee o_name
    iif(colname='sal',colval)

    step 4: please enable group by option for the employee number.

    Please get back to us in case of queries.

    Thx,
    prakash


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact