Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IN condition in where clause

3410314Apr 9 2018 — edited Apr 9 2018

A third party program generated a statement like the following:

select ...

where ...

   and fieldA = (fieldB in ('TXT'));

causing ORA-00907: missing right parenthesis.

So I broke it down to an example:

select * from dual

where 'X' = (dummy in ('X'));

or

select * from dual

where (dummy = (dummy in ('X')));

causing the same error. Of course it can be simplified like,

select * from dual

where dummy in ('X');

which works just fine. My questions however are:

- Why is it an ORA-00907 error?

- I feel like this syntax could actually be helpful in some case, is there a way to make it work?

- As it was a generated statement, has it something to do with the oracle version (using 12c)?

greetings

This post has been answered by AndrewSayer on Apr 9 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 7 2018
Added on Apr 9 2018
5 comments
324 views