Skip to content
Advertisement

How to use like and in together in sql statement?

If I use this code, I get an error

ORA-00936: missing expression

There seems to be no error logically, but I am wondering which part of the code above is wrong.

I’m also curious about a way to replace LIKE IN.

Advertisement

Answer

Removing LIKE from your current WHERE clause leaves it valid:

It isn’t clear from what you posted alone above why you think you need LIKE here. If you wanted to express the above logic using LIKE, you could use:

Note that if your version of SQL supports regex like, you could also use the regex pattern ^[klb].

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement