[오라클 sql]case when 조건 then 리턴값1 else 리턴값2 end
case when 조건 then 리턴값1 else 리턴값2 end select * from (select '1' as v_sex, '2' as SEX_CD from dual) where ( CASE WHEN v_sex= '1' THEN decode(SEX_CD,'1',1,'2',0,'3',1,'4',0) WHEN v_sex= '2' THEN decode(SEX_CD,'1',0,'2',1,'3',0,'4',1) ELSE decode(SEX_CD,'1',1,'2',1,'3',1,'4',1,0) END ) =1
2012. 9. 19.