title: How to get a one-to-many result when the MySQL query is based on a second relationship in the related table?
body: <p>I'm a real noob to MySQL and I'm not even certain that the question was worded correctly.</p>
  
  <p>The database has two tables, Products and Feedback. The fields in the Products table are sku and variations. There can be multiple variations for a single sku. The fields in the Feedback table are variation, title, text. There is a one-to-many relationship between Products.variations and Feedback.variations. </p>
  
  <p>The goal is a query that returns the title and text of all Feedback for all of the variations of a single product.</p>
  
  <p>My code doesn't work. In the example below, I want all Feedback when sku='proda'.</p>
  
  <pre><code>SELECT DISTINCT Products.variations, Products.sku, Feedback.variations, Feedback.title, Feedback.text
  WHERE Products.sku='proda'
  inner join Products.sku ON Products.variations = Feedback.variations 
  </code></pre>
  
  <p>This the error:</p>
  
  <blockquote>
    <p>1064 - You have an error in your SQL syntax; ... near 'WHERE Products.sku='proda'<br>
    inner joi' at line 2</p>
  </blockquote>