title: MySQL GROUP BY...HAVING different values same field
body: <p>I want to use a query similar to the following to retrieve all rows in <code>events</code> that have at least one corresponding <code>event_attendances</code> row for <code>'male'</code> and <code>'female'</code>. The below query returns no rows (where there certainly are some <code>events</code> that have <code>event_attendances</code> from both genders).</p>
  
  <p>Is there a way to do this without a subquery (due to the way the SQL is being generated in my application, a subquery would be considerably more difficult for me to implement)?</p>
  
  <pre><code>SELECT * FROM events e
  LEFT JOIN event_attendances ea ON (e.id = ea.event_id)
  GROUP BY e.id
  HAVING ea.gender = 'female' AND ea.gender = 'male'
  </code></pre>