Skip to content
Advertisement

ORA-00905: missing keyword in case statement

I am getting ORA-00905: missing keyword in case statement in my when clause. Below is the query.

JavaScript

Advertisement

Answer

You can’t have a boolean value as a selectable something in a query in oracle, you can only make boolean expressions in e.g. the WHERE/ON clauses etc

i.e. this is invalid:

JavaScript

This is valid:

JavaScript

You could later compare these values to something to realize a boolean:

JavaScript

But you can’t use booleans on their own.. This is also invalid:

JavaScript

in your case, promote the booleans the case is trying to realize, into the WHERE predicates:

JavaScript

(I left the case when in as comments to show you what was edited)

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