title: Select to PIVOT
body: <p>I have table in SQL as :</p>
  
  <pre><code>DefultDim   Name,         DisplayValue
  -------------------------------------
  5637145329, B_MainSector,   4
  5637145329, C_SecondSector, 401
  5637145329, D_ThirdSection, 40100
  5637145329, E_Vendor,       0032
  </code></pre>
  
  <p>I want to use select to see as :</p>
  
  <pre><code>DefultDim,  B_MainSector,   C_SecondSector, D_ThirdSection, E_Vendor
  --------------------------------------------------------------------
  5637145329   4             401              40100           0032
  </code></pre>
  
  <p>I use this code :</p>
  
  <pre><code>select DEFAULTDIMENSION AS FULLDIM ,[0] AS B_MainSector ,[1] AS C_SecondSector ,[2] AS D_ThirdSection ,[3] AS E_Vendor
  from
  (select DEFAULTDIMENSION,NAME,RECID,DISPLAYVALUE from DEFAULTDIMENSIONVIEW )
  P PIVOT  (max(DISPLAYVALUE) 
  for DISPLAYVALUE in([0],[1],[2],[3])) as PVT 
  </code></pre>
  
  <p>But results seem as :</p>
  
  <pre><code>DefultDim   B_MainSector    C_SecondSector  D_ThirdSection  E_Vendor
  --------------------------------------------------------------------
  5637145329, NULL,   NULL,   NULL,   NULL
  5637145329, NULL,   NULL,   NULL,   NULL
  5637145329, NULL,   NULL,   NULL,   NULL
  5637145329, NULL,   NULL,   NULL,   NULL
  </code></pre>
  
  <p>Kindly help.</p>