SQL Server Performance

Using Pivot with a matrix-like table

Discussion in 'SQL Server 2005 Analysis Services' started by EMoscosoCam, May 2, 2007.

  1. EMoscosoCam Member

    Hello

    I have a table which is declared as Matrix(#Row as int, #Column as int, Value as numeric); this table stores data of a real matrix which has 20 rows and 5 columns. I would like to make a SELECT statement that uses the PIVOT operator in order to make a resultset of the matrix. Something like:

    Row Col1 Col2 Col3 Col4 Col5
    1 23 45 46 78 89
    2 12 56 34 79 23
    ...

    The data is stored as (select * from Matrix):
    1, 1, 23
    1, 2, 45
    1, 3, 46
    ...

    Thanks a lot.
  2. MohammedU New Member

Share This Page