Thread: Transporse ?

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Transporse ?


    I have a Postgresql function in which gives me the following o/p :

    Sl.no username Designation salary etc..
    1 A XYZ 10000 ....
    2 B RTS 50000 .....
    3 C QWE 20000 ....
    4 D HGD 34343 ...

    Now I want the Output as below :

    Sl.no 1 2 3 4 .....
    Username A B C D ...
    Designation XYZ RTS QWE HGD ....
    Salary 10000 50000 20000 34343 .......

    How to do this ?? Please help or any advice would be helpful.
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Location
    Australia
    Posts
    9
    Rep Power
    0
    Originally Posted by rahul.r
    I have a Postgresql function in which gives me the following o/p :

    Sl.no username Designation salary etc..
    1 A XYZ 10000 ....
    2 B RTS 50000 .....
    3 C QWE 20000 ....
    4 D HGD 34343 ...

    Now I want the Output as below :

    Sl.no 1 2 3 4 .....
    Username A B C D ...
    Designation XYZ RTS QWE HGD ....
    Salary 10000 50000 20000 34343 .......

    How to do this ?? Please help or any advice would be helpful.
    Hmmm, I can't post URLs yet, but try Googling the following and then clicking on the first two results:

    MAX(CASE WHEN r.question_id = 1

    Do any of those posts help you?

IMN logo majestic logo threadwatch logo seochat tools logo