title: MySQL "REPLACE INTO" using a SELECT to pull one field
body: <p>I've got a MySQL database that has two tables (actually many more).  The first table links a product's SKU number to an arbitrary ID.  There is a second table that records the End of Day inventory for each item based on this ID.  When the inventory is changed for reasons OTHER than sales, there is a record placed in this second table with a Boolean set to false.  This allows me to say that this new number is not valid as a vector for sales previous, but is for the next day's sales.</p>
  
  <p>There is some syntax error in this code.  I'm still a student, and would greatly appreciate the help in explaining how this kind of update would work.  I know the first value needs to come from the select statement?</p>
  
  <p>Here is my current MySQL statement:</p>
  
  <pre><code>REPLACE INTO sales (`itemID`, `date`, `qty`, `price`) 
  VALUES ([itemID], CURDATE(), [qty], 0.00) 
  SELECT itemID FROM item WHERE `sku` = [sku]
  </code></pre>