Link to home
Start Free TrialLog in
Avatar of Shaunsmith
ShaunsmithFlag for United States of America

asked on

LIMIT not working in Oracle 10

SELECT DISTINCT EMP_NO
FROM EMPLOYEE E
ORDER BY EMP_NO
LIMIT 1

For some reason LIMIT does not seem to work in Oracle .I use dbvisualizer and I always get
" ORA-00933: SQL command not properly ended" when I use LIMIT .

I tried the simplest queries but I dont seem to get it .Even the db visualizer is not seeing it as a reserved work . Am I doing something wrong ?
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

>>FROM ( select * from EMPLOYEE E ORDER BY EMP_NO desc) where

I would not do a "select *" here since it can cause a full table scan.  Emp_no is likely indexed so just select it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial