title: Oracle: using WHERE ROWNUM = 1
body: <p>chaps and chapettes</p>
  
  <p>Just a quick question. I need to return only one row from a stored proc., but no matter where I place the WHERE clause, I get errors. Can somebody take a look at the (cut-down due to sheer length) code and let me know where it should go, please?</p>
  
  <pre><code>SELECT        **values** 
  
  INTO          **variables**                  
  
  FROM          **table**
  
  _WHERE        ROWNUM = 1_
  
  INNER JOIN    **other table**
  ON            **join target**
  ORDER BY      **sort criteria**;
  
  _WHERE        ROWNUM = 1_
  </code></pre>
  
  <p>Thanks</p>