语法:
decode(expression,value,result1,result2)
如果expression=value,则输出result1,否则输出result2
示例:
select USER_NAME userName,max(EXAM_SCORE) examScore from EXAM_USER WHERE ((decode(?1,‘‘,1, 0) = 1) or DEPT_NAME = ?1) and QUESTION_TYPE is not null and EXAM_SCORE is not null GROUP BY USER_NAME