Re: matrix transpose in SQL?

From: Vadim Tropashko <nospam_at_newsranger.com>
Date: Fri, 27 Apr 2001 16:44:10 GMT
Message-ID: <ulhG6.959$SZ5.77667_at_www.newsranger.com>


In article <u766fqu11o.fsf_at_sol6.ebi.ac.uk>, Philip Lijnzaad says...
>
>
>> Why are you insisting that matrix must be modeled in RDBMS that way? There
>> is a symmetry between rows and columns in matrix, and you loose it in your
>> representation.
>
>Yes, I agree: this table:
>
>> 1 2 3
>> 4 5 6
>> 7 8 9
>
>is _not_ a matrix. It is an _unordered_ set of rows of numbers. This:
>
>> 1 2 3
>> 7 8 9
>> 4 5 6
>
>is exactly the same table, and in fact the SQL standard does not guarantee
>that the order of rows you get from a query is always the same, not even when
>when no updates to the table happened (although in practice it usually does).
>
>The cleanest way to represent matrices is of course:
>
>I J VALUE
>1 1 1
>1 2 2
>1 3 3
>2 1 4
>2 2 5
>2 3 6
>3 1 7
>3 2 8
>3 3 9
>

Aakash,

If those ideas were not convincing enough, think of matrix as just a tensor of the second rank. Would you ever represent a tensor of rank 3 like this

dim | a11 | a12 | a21 | a22



1 | 111 | 112 | 121 | 122
2 | 211 | 212 | 221 | 222

? Received on Fri Apr 27 2001 - 18:44:10 CEST

Original text of this message