title: SQL How to Delete Data from Table Using INNER JOIN
body: <p>I'm trying to delete all records form the table "oc_products" that don't have a certain category ID. I created a SELECT query that lists those products using an INNER JOIN, since the categories are in a separate table.</p>
  
  <p>What I can't figure out is how to use the DELETE function to delete the shown records.</p>
  
  <p>This is what my code looks like:</p>
  
  <pre><code>DELETE oc_product
  FROM oc_product
  INNER JOIN oc_product_to_category ON oc_product.product_id = oc_product_to_category.product_id
  WHERE oc_product_to_category.category_id = 343
  </code></pre>
  
  <p>Its showing the error "Unexpected keyword, (near INNER JOIN)".</p>