title: Case for range of numbers excluding specific number - SQL Server
body: <p>I have this query</p>
  
  <pre><code>SELECT * ,
  CASE WHEN FigureID &gt;= 0 AND &lt;= 10 AND &lt;&gt; 5
  THEN 'Group1' ELSE 'Group2' END AS 'Group'
  FROM
  Figure
  </code></pre>
  
  <p>Now i am looking to include all numbers between 1-10 in the case statement but exclude 5. Is there anyway to do so that '5' is excluded specifically.</p>
  
  <p>I have tried this but it still doesn't give me the result i am looking for.</p>
  
  <pre><code> SELECT * ,
   CASE WHEN FigureID &lt;= 4 AND FigureID &gt;= 6
   THEN 'Group1' ELSE 'Group2' END AS 'Group'
   FROM
   Figure
  </code></pre>
  
  <p>Example result</p>
  
  <pre><code>FigureID    Amount  Group
     1          10    Group1
     2          10    Group1
     3          10    Group1
     4          10    Group1
     5          10    N/a
     6          10    Group1
  </code></pre>
  
  <p>SQL fiddle - <a href="http://sqlfiddle.com/#!6/30e2c/11" rel="nofollow noreferrer">http://sqlfiddle.com/#!6/30e2c/11</a></p>
  
  <p>thanks</p>