title: Mysql Group BY with if statement
body: <p>I'm not sure if this is something you can do in a single select statement without nesting selects. </p>
  
  <p>I am grouping my results and I want to know IF a field inside the entire grouping contains a condition, display yes. With this it will just take the first row from the group and check the condition instead of all the rows in the group</p>
  
  <pre><code>if(field = 'condition','yes','no') as field_found
  </code></pre>