How to limit the results to 1 row in Oracle SQL
<p>I've this query which runs successfuly</p>

<pre><code>SELECT customerNumber
FROM ORDERS 
GROUP BY customerNumber 
ORDER BY count(orderNumber) DESC
</code></pre>

<p>But when I try to limit the number of rows returned to 1, I get the following error</p>

<pre><code>ORA-00933: SQL command not properly ended 
</code></pre>

<p>Here's what I've tried :</p>

<pre><code>SELECT customerNumber
FROM ORDERS 
GROUP BY customerNumber 
ORDER BY count(orderNumber) DESC
fetch first 1 row only;
</code></pre>

<p>and </p>

<pre><code>SELECT customerNumber
FROM ORDERS 
GROUP BY customerNumber 
ORDER BY count(orderNumber) DESC
WHERE ROWNUM=1;
</code></pre>