SELECT TOP 1 .... ORDER BY
443470Oct 14 2005 — edited Oct 17 2005Hi,
I have the following statement in SQL SERVER:
SELECT TOP 1 NAME FROM STUDENT ORDER BYGRADE
Now, I am trying to translate it ti ORACLE PLSQL, I came up with this statement:
SELECT NAME FROM STUDENT WHERE ROWNUM=1 ORDER BY GRADE
It doesn't work. I guess ORACLE generates ROWNUM before the ORDER BY operation...
How can I have SELECT TOP N ... ORDER BY ... in Oracle the way that I have it in SQL server?
Any help would be apprecited,
Alan