Fun with Oracle DB: ORA-00907

Following SQL select statement

 
select * from A a
where a.id in (select b.id from B b order by b.id)

leads to an error message:

 
> ORA-00907: missing right parenthesis 

Hm. I don't see anything missing... Ok, let's remove the order clause, as it is not really needed:

 
select * from A a
where a.id in (select b.id from B b)

No ORA-00907. I am not the only one having these troubles, see the blog post by oraclequirks.

Original post: http://peter-on-java.blogspot.com/2012/03/fun-with-oracle-db-ora-00907missing.html

Tags database