title: SQL Server - What's the right query for this purpose?
body: <p>I have a TABLE that contains, for example:</p>
  
  <pre><code>ID        CVG
  4         A
  4         C
  5         B
  </code></pre>
  
  <p>Each row contains a coverage for a given ID. If the ID does not have a coverage, there will be no row in the table (ex. ID 4 has no coverage B). </p>
  
  <p>From this table I want to write a query like </p>
  
  <pre><code>SELECT ID, A = case (when ??? then 'TRUE'  when ??? then 'FALSE'), B = case (...), C = case (...) FROM TABLE
  </code></pre>
  
  <p>that will give the output</p>
  
  <pre><code>ID       A       B        C
  4        TRUE    FALSE    TRUE
  5        FALSE   TRUE     FALSE
  </code></pre>
  
  <p>where there is only one row for each ID, and one column for each coverage.</p>
  
  <p>What's a workable query for this? I'm not allowed to change any permanent tables on the server so I'm trying to reach a solution with what I have. </p>