Link to home
Start Free TrialLog in
Avatar of sakthikumar
sakthikumar

asked on

Converting a row into a column

Hi,

Below is my table

create table question_master
(questions varchar2(1000),
 color    varchar2(20),
 row_no      number);

and below is my query and result.


select questions, null choice from question_master where row_no =1;

QUESTIONS                                                      Choice
Authentic Harmonious Compassionate      null
Versatile Inventive Competent                      null
Parental Traditional Responsible                  null
Active Opportunistic Spontaneous               null

Now I want the result to be converted like this.

Authentic Harmonious Compassionate   Versatile Inventive Competent   Parental Traditional Responsible Active Opportunistic
                                                                                                                                                                                             Spontaneous


choice       null                                                null                                                   null                              null

how I can achieve this, Also I don't want to use the resulting values inside the query, like decode(QUESTIONS,                                      "Authentic Harmonious Compassionate',...)

Is there a way to do this.?
Avatar of Geert G
Geert G
Flag of Belgium image

well, you'll have to do that in code

i was going to suggest pivot, but then i saw you want the content of the row as the column header
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial