title: MYSQL Distinct Query on multiple columns
body: <p>I want to select the data from the Food Table on userid but the foodname should be distinct.</p>
  
  <p>I have used the following query </p>
  
  <pre><code>SELECT * 
  FROM Food 
  WHERE cfid IN (
      SELECT distinct(foodname) FROM Food WHERE userid=234
  );
  </code></pre>
  
  <p>but it returns an empty set of data.</p>
  
  <p>Food Table </p>
  
  <pre><code>cfid foodname            userid brand
   160 special chapati        234 homemade
   161 chicken fry special    234 kfc
   162 apple punch            234 homemade
   164 pohapokri              234 homemade
   165 pohapokri              234 homemade
   167 besan gatte            234 home made
   168 besan gatte            234 home made
   169 pohapokri              234 homemade
   172 chicken fry special    234 kfc
   174 special chapati        234 homemade
   175 special chapati        234 homemade
  </code></pre>