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
Post a Comment