title: Why is my UPDATE query updating all rows?
body: <p>I am trying to update the row most recently added to my table by adding a WHERE clause and selecting the MAX 'dressingID' which is my primary key.</p>
  
  <p>The function is working however it is returning every row instead of just the row with the largest ID.</p>
  
  <p>Here is the query:</p>
  
  <pre><code>UPDATE Dressing set dressingCode='111' WHERE dressingID=(SELECT MAX(dressingID))
  </code></pre>
  
  <p>Table Name = Dressing</p>
  
  <p>Primary Key = dressingID</p>
  
  <p>I am trying to get a number from a QR code and pass to to the latest entry into the table, however it is updating every row for some reason, any help would be appreciated. Cheers!</p>