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.?
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.?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
i was going to suggest pivot, but then i saw you want the content of the row as the column header