title: Mysql Query. Best way to get the query
body: <p><code>
   field1|field2
   51301 | FOO
   51301 | FOO
   51302 | FOO
   51302 | BAR
   51302 | FOOBAR
   51302 | FOOBAR
   51303 | BAR
   51303 | BAR
  </code></p>
  
  <p>Field2 may contains FOO, BAR or FOOBAR. Mysql query to get all field1 if any point of time field2 had FOO and BAR and FOOBAR. In other words give me field1 if field2 has been set to FOO, BAR and FOOBAR. Order is not important.</p>
  
  <p><code>
  select field1 from mytable_audit group by id, field2 having field2 in ('FOO', 'BAR', 'FOOBAR');
  </code></p>
  
  <p>But it is getting results either field2 is either FOO, BAR or FOOBAR. Is there any way to get result if field2 is FOO and BAR and FOOBAR at some point of time.</p>