Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Table on its side

Table on its side

From: David Turner <dturner_at_linuxcare.com>
Date: Mon, 19 Jun 2000 10:00:59 -0700
Message-Id: <10533.109735@fatcity.com>

--------------B21FE9AA38CA3E9E6C12E925
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Has anyone had any experience turning a table on its side?

For example:

I have a table A
with columns id and name

and I want to have all the records represented as columns

So say I have 5 records in the table here is what the query would show:

Id Name1 Name2 Name3 Name4 Name5
1 Bhope LWelk TDanza SLee SCue

Now I can do this with a self join 5 times but if I add a record I lose the info in the 6th record.

Is there any way to dynamically handle this?

Thanks, Dave Turner

--
Dave Turner, Senior Database Administrator, Linuxcare, Inc.
913.383.3052 tel, 913.579.3803 cel, 913.652.0687 fax, 877.443.9553 pager
dturner@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.
--



--------------B21FE9AA38CA3E9E6C12E925
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit


<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Has anyone had any experience turning a table on its side?
<p>For example:
<p>I have a table&nbsp; A
<br>with columns id and name
<p>and I want to have all the records represented as columns
<p>So say I&nbsp;have 5 records in the table here is what the query would
show:
<p>Id&nbsp;&nbsp; Name1 Name2 Name3 Name4 Name5
<br>1&nbsp;&nbsp;&nbsp;&nbsp; Bhope&nbsp;&nbsp; LWelk&nbsp;&nbsp; TDanza
SLee&nbsp;&nbsp; SCue
<br>&nbsp;
<p>Now I can do this with a self join 5 times but if I add a record I lose
the info in the 6th record.
<p>Is there any way to dynamically handle this?
<br>&nbsp;
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Thanks, Dave Turner
<br>&nbsp;
<pre>--
Dave Turner, Senior Database Administrator, Linuxcare, Inc. 913.383.3052 tel, 913.579.3803 cel, 913.652.0687 fax, 877.443.9553 pager&nbsp; dturner@linuxcare.com, <A HREF="http://www.linuxcare.com/">http://www.linuxcare.com/</A> Linuxcare. Support for the revolution. --</pre>
Received on Mon Jun 19 2000 - 12:00:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US