title: Query builder GROUP BY, HAVING, COUNT in Laravel
body: <p>how to express this code in query builder. I'm using Laravel 6.</p>
  
  <pre><code>SELECT * FROM feedback GROUP BY noTicket having count(`status`) &lt; 2 
  </code></pre>
  
  <p>My Code:</p>
  
  <pre><code>$feedback = DB::table('feedback')
              -&gt;groupBy('noTicket')
              -&gt;having('count(status)', '&lt;', 2)
              -&gt;get();
  </code></pre>
  
  <p>Error Code:</p>
  
  <pre><code>SQLSTATE[42000]: Syntax error or access violation: 1055 'sifora.feedback.idFeedback' isn't in GROUP BY 
  (SQL: select * from `feedback` group by `noTicket` having `count(status)` &lt; 2) 
  </code></pre>
  
  <p>What is wrong with my code? It seems match between sql code vs query builder.</p>
  
  <p>Thank you</p>