Solved

Column to Rows

Posted on 2011-02-28
2
353 Views
Last Modified: 2012-08-13
Dears,

i have a table with one column, i want to a query to show this column as rows and columns as below:

      Column1 | Column2|Column3|Column4
Row1      AA               AB          AC          AD
Row2      AE               AF          AG         AH
Row3      AI                BA          BB         BC
Row4 .............................



to make it easier here is the table:

create table TST
(
  X VARCHAR2(10)
);

Values:


insert into tst(x) values ('AA');
insert into tst(x) values ('AB');
insert into tst(x) values ('AC');
insert into tst(x) values ('AD');
insert into tst(x) values ('AE');
insert into tst(x) values ('AF');
insert into tst(x) values ('AG');
insert into tst(x) values ('AH');
insert into tst(x) values ('AI');
insert into tst(x) values ('BA');
insert into tst(x) values ('BB');
insert into tst(x) values ('BC');




thanks all
0
Comment
Question by:Balshe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 34997174
try this...
ee.txt
0
 
LVL 1

Author Comment

by:Balshe
ID: 34997217
Thanks a lot man
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question