title: Using having count cause between two numbers, so I can use a range inside the having count clause
body: <pre><code>select patientid, illnessid, count(1) as myrange    
  from database (nolock)    
  where diagnosetime between '2020-08-27' and '2020-08-28'    
  group by PJMBatchId, PJMCltId
  HAVING COUNT(*) &gt;= 2;
  having count (*) &gt;= 5;
  </code></pre>
  <p>So I want to combine my having count so it can count between 2 and 5, is there way to do it,</p>