Case in oracle sql -


what wrong code?

select emp_id, emp_name  emp  case  when :emp.designation_id = '008' designation_id = '003' 

case expression returns value. , case expression ends end. , case expression returns valid type.

perhaps intend:

select emp_id, emp_name  emp designation_id = (case when :emp.designation_id = '008' designation_id = '003' end); 

a simpler way express this logic without case is:

where :emp.designation_id = '008' , designation_id = '003' 

but intend:

where (:emp.designation_id = '008' , designation_id = '003') or       (:emp.designation_id <> '008' , designation_id = :emp.designation_id) 

Comments

Popular posts from this blog

minify - Minimizing css files -

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -