Anonymous Anonymous - 5 months ago 24
SQL Question

FROM keyword not found

I am getting an error, even though I actually do have the keyword!

Here's my code:

SELECT TOP(10) * FROM TABLE_NAME


Here's the error:


[42000][923] ORA-00923: FROM keyword not found where expected


What am I doing wrong?

Answer

Here is the right way of accessing top # rows

SELECT * FROM TABLE_NAME
WHERE ROWNUM <= 10