title: GROUP BY multiple values in same column
body: <p>I have this SQL Query:</p>
  
  <pre><code>select prefix, code, stat, complete, COUNT(*) as Count
  from table
  group by prefix, code, stat, complete
  order by prefix, code, stat, complete
  </code></pre>
  
  <p>The column 'prefix' is an alphanumeric value (0-9a-zA-z).
  What I want is to make it so that if the value of prefix is a number, to make the number equal to 0. If it is a letter, it will keep its value. I have tried to add the following line beneath the group by clause:</p>
  
  <pre><code>(case when prefix like '%[0-9]%' then 0 else prefix end)
  </code></pre>
  
  <p>But I get an error "Conversion failed when converting the varchar value 'J' to data type int.".</p>
  
  <p>What is causing this error? How can I get the 'prefix' column to display either 0 or a letter?</p>