cursor.execute("select name,marks from student order by marks desc limit 5")
cx_Oracle.DatabaseError:ORA-00933:SQL命令未正确结束
如何解决此错误?还有什么其他方法可以重述查询?此查询有什么问题?
limit
不是Oracle SQL语法的一部分。您可以在此类用例中使用fetch first
:
cursor.execute("select name, marks from student order by marks desc fetch first 5 rows only")