title: Room Update Multiple Fields
body: <p>I would like to update some fields from <code>table 1</code> to be the same as the values from another <code>table</code> (or even a subquery). The issue is I get a <code>compilation error</code> in my <code>DAO</code> update query when there is more than 1 field.</p>
  
  <p>You can see the code (rewritten to be generic) below:</p>
  
  <pre class="lang-sql prettyprint-override"><code>@Query("UPDATE table1 " +
       " SET (field1, field2) = " +
       " (SELECT SUM(table2.foreign_field1) as summaryForeign_field1, table2.foreign_field2 " +
       " FROM table2 " +
       " WHERE   table1.id = table2.id " + 
       " GROUP BY table2.foreign_field2 ) ")
  void setFieldsInTable1();
  </code></pre>
  
  <p>I checked the query with the notes in <a href="https://sqlite.org/rowvalue.html#row_values_in_update_statements" rel="nofollow noreferrer">SQLite Update Query Ref</a> and I have tried the code in <code>DB Browser</code> for <code>SQLite</code> where it works fine.</p>
  
  <p>Any help would be greatly appreciated.</p>