title: SQL Server : multiple lines returned for CASE WHEN
body: <p>I am trying to select from a single table specific sets of data and then display them grouped under a single field. This however creates a line for each case statement.</p>
  
  <p>I would ideally like to see a single line for each Quote with each of the fields against it.</p>
  
  <p>Would anyone have any ideas how i could improve on what ive done so far?</p>
  
  <pre><code>select
     KeyField as Quote,
     CASE WHEN FieldName = 'QTY001' THEN AlphaValue ELSE null END as [QTY],
     CASE WHEN FieldName = 'CON002' THEN AlphaValue ELSE null END as [Conductors],
     CASE WHEN FieldName = 'COP001' THEN AlphaValue ELSE null END as [Copper Size],
     CASE WHEN FieldName = 'COR001' THEN AlphaValue ELSE null END as [Core Length],
     CASE WHEN FieldName = 'COR002' THEN AlphaValue ELSE null END as [Core Inside],
     CASE WHEN FieldName = 'END001' THEN AlphaValue ELSE null END as [End Winding],
     CASE WHEN FieldName = 'KV_001' THEN AlphaValue ELSE null END as [KV],
     CASE WHEN FieldName = 'KW_001' THEN AlphaValue ELSE null END as [KW],
     CASE WHEN FieldName = 'NAM001' THEN AlphaValue ELSE null END as [OEM],
     CASE WHEN FieldName = 'SLO001' THEN AlphaValue ELSE null END as [Slots],
     CASE WHEN FieldName = 'SPE001' THEN AlphaValue ELSE null END as [Speed],
     CASE WHEN FieldName = 'TUR001' THEN AlphaValue ELSE null END as [Turns],
     CASE WHEN FieldName = 'TYP001' THEN AlphaValue ELSE null END as [Type/Description]
  from 
     AdmFormData 
  where 
     FormType = 'QOT'
  </code></pre>