title: ORACLE : WITH CLAUSE & FOR UPDATE NOWAIT
body: <p>In a simple join, I would like to limit the results of the first table. So I thought about doing this :</p>
  
  <pre><code>WITH events  AS (SELECT event FROM risk_event WHERE status = 'ABC' AND rownum &lt;= 20) 
  SELECT event_id
          FROM events ev, attributes att
          WHERE ev.event_id = att.risk_event_id
          FOR UPDATE NOWAIT
  </code></pre>
  
  <p>The problem is that I get an <code>ORA-02014: cannot select FOR UPDATE from view</code> exception because of the <code>rownum&lt;=20</code> and the <code>FOR UPDATE NOWAIT</code>'.</p>
  
  <p>I know that I can do it with a inner in clause as well, but I'm wondering if there is a better way?</p>