title: DB2 rownum equivalent
body: <p>I have the below query in Oracle which I want to replicate in DB2 which uses the random function and the rownum.</p>
  
  <p>Oracle Query : </p>
  
  <pre><code>SELECT * 
  FROM  (
     SELECT * 
     FROM db2admin.QUESTION_BANK 
     WHERE type='PROCESS' 
     ORDER BY dbms_random.value
  ) WHERE rownum &lt;=?
  </code></pre>
  
  <p>I got alternate for random function but nothing for rownum. Below is query in DB2,</p>
  
  <pre><code>SELECT * 
  FROM  (
    SELECT * 
    FROM db2admin.QUESTION_BANK 
    WHERE type='PROCESS' ORDER BY RAND
  ) WHERE rownum &lt;= ?
  </code></pre>
  
  <p>The value for rownum is passed via PreparedStatement.</p>