title: SQL select if count
body: <p>i have two tables
  Incident (id, date)
  Reminder (incidentID, type)
  inner join on incident.id = reminder.incidentID</p>
  
  <p>and i want to take incident.id only if it has more than 4 reminder.type = 15
  what i think is</p>
  
  <pre><code>SELECT incident.id
  FROM incident
  INNER JOIN reminder ON incident.id = reminder.incidentid 
  HAVING COUNT (reminder.remindertype = "something") &gt;5
  GROUP BY incident.incidentcode
  </code></pre>
  
  <p>The erroe i get is </p>
  
  <blockquote>
    <p>Line 6: Incorrect syntax near '='.</p>
  </blockquote>
  
  <p>What can i do?</p>