home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,008 of 19,505   
   migurus to migurus   
   Re: how to make a matrix from a series o   
   11 Feb 14 15:21:08   
   
   From: migurus@yahoo.com   
      
   On Tuesday, February 11, 2014 9:49:19 AM UTC-8, migurus wrote:   
   > I have following input:   
   >   
   >   
   >   
   > select TIER1, TIER2, AMOUNT   
   >   
   > from   RESULT_SET1;   
   >   
   >   
   >   
   > TIER1 TIER2 AMOUNT   
   >   
   > ===== ===== ======   
   >   
   > 1     1     400   
   >   
   > 1     2     150   
   >   
   > 1     3     100   
   >   
   > 2     1     300   
   >   
   > 2     2     20   
   >   
   > 2     3     30   
   >   
   >   
   >   
   > I need to build a matrix out of it, as below:   
   >   
   >   
   >   
   >   
   >   
   >       TIER1   
   >   
   >       =====   =====   
   >   
   >       1       2   
   >   
   > T   
   >   
   > I 1 :  40%     30%   
   >   
   > E 2 :  15%      2%   
   >   
   > R 3 :  10%      3%   
   >   
   > 2   
   >   
   >   
   >   
   > I can't wrap my brain around making a matrix out of series of values I get   
   from my result set. Any ideas would by much appreciated. We run SQL Server   
   2008.   
      
   Thank You!   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca