From: "Aakash Bordia" <a_bordia@hotmail.com>
Newsgroups: alt.comp.databases,comp.databases,comp.databases.theory
Subject: Re: matrix transpose in SQL?
Date: Thu, 26 Apr 2001 13:13:12 -0700
Organization: IBM, San Jose Area
Lines: 46
Message-ID: <9c9vbp$efu$1@stlnews.stl.ibm.com>
References: <9c9l22$f9g$1@stlnews.stl.ibm.com> <uPZF6.6750$QV4.573533@www.newsranger.com>
NNTP-Posting-Host: bordia.stl.ibm.com
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200


Well I should have rephrased that!
Given the data like:
col1 col2 col3
1     2         3
4     5         6
7     8         9
How will we do it now?
We want our table to contain physically:
1 4 7
2 5 8
3 6 9
Thanks
Aakash

"Mik harakiri" <nospam@newsranger.com> wrote in message
news:uPZF6.6750$QV4.573533@www.newsranger.com...
> In article <9c9l22$f9g$1@stlnews.stl.ibm.com>, Aakash Bordia says...
> >
> >Hello, Can we do matrix transpose (row become columns and columns become
> >rows) in standard SQL?
> >eg:
> >
> >1 2 3
> >4 5 6
> >7 8 9
> >
> >changes to
> >
> >1 4 7
> >2 5 8
> >3 6 9
> >
> Depends how do you want to represent matrix. If, for example, like this
>
> table Matrix (
> row NUMBER,
> column NUMBER,
> data NUMBER
> )
>
> then transposition is just a trivial matter of renaming columns in RA or
> aliasing in SQL.
>
>



