title: Case when rowcount
body: <pre><code> SELECT distinct ID from table
  </code></pre>
  
  <p>Result</p>
  
  <pre><code>    Letter
  1   A
  2   B
  </code></pre>
  
  <p>How can I make the select display the following when the result is as above:</p>
  
  <p>What I was thinking but not working yet:</p>
  
  <pre><code>SELECT CASE WHEN @@ROWCOUNT(ID) = 2 THEN 'AB'
  ELSE ID END AS ID
  FROM table
  </code></pre>
  
  <p>Result would be</p>
  
  <pre><code>     Letter
  1    AB
  </code></pre>