title: Updating rows using "in" operator in "where" clause
body: <p>I stumbled upon SQL behavior I don't understand.  I needed to update several rows in a table at once; started with just finding them:</p>
  
  <pre><code>SELECT * FROM some_table WHERE field1 IN (SELECT ...)
  </code></pre>
  
  <p>This returned a selection of about 60 rows.  Now I was pretty confident I got the subquery right, so I modified <em>the first part only</em>:</p>
  
  <pre><code>UPDATE some_table SET field2 = some_value WHERE field1 IN (SELECT ...)
  </code></pre>
  
  <p>In other words, this was exactly as the first query after the <code>WHERE</code>.  However, it resulted in 0 rows updated, whereas I would expect those 60.  Note that the statement above <em>would</em> change <code>field2</code>, i.e. I verified that <code>some_value</code> was not present in the selected rows.</p>
  
  <p>The subquery was a modestly complicated SQL piece with 2 (different) tables, 1 view, joins and its own <code>WHERE</code> clause.  In case this matters, it happened with Oracle Database 10g.</p>
  
  <p>So, the question is, <strong>why <code>UPDATE</code> didn't touch the rows returned by <code>SELECT</code></strong>?</p>