title: Why do backticks not work in the SET part of an UPDATE query (for MySQL)?
body: <p>The following SQL</p>
  
  <pre><code>UPDATE line_items SET `line_items.quantity` = 2 where line_items.id = 1234;
  </code></pre>
  
  <p>gives me this error:</p>
  
  <pre><code>ERROR 1054 (42S22): Unknown column 'line_items.quantity' in 'field list'
  </code></pre>
  
  <p>However, these queries all work as expected:</p>
  
  <pre><code>UPDATE line_items SET line_items.quantity = 2 where line_items.id = 1234;
  UPDATE line_items SET `quantity` = 2 where line_items.id = 1234;
  UPDATE line_items SET quantity = 2 where line_items.id = 1234;
  </code></pre>
  
  <p>Any reason why backticks would not work in this specific case?</p>
  
  <p>My current MySQL version is <code>Server version: 5.5.43-0ubuntu0.14.04.1 (Ubuntu)</code> which I installed last week. I haven't tried other versions.</p>
  
  <p>The reason I ask is I have a more complicated UPDATE+JOIN query that Ruby on Rails is generating which does not work because Rails adds the backticks. I'm trying to figure out who's at fault: Rails, MySQL, or me :-)</p>